Needs work
Project:
Flexinode
Version:
master
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2005 at 00:46 UTC
Updated:
3 Oct 2006 at 13:39 UTC
Jump to comment: Most recent file
I modified the field_timestamp.inc file to allow for a wider variety of dates (years before 1970 as well). Now, if I post a node with a date before 1970, the node view and flexinode table and list views of the node display the date as 1970-01-01, but the trip_search results page returns the dates correctly. From this I gather that the problem is in the flexinode code.
note: I also patched my Drupal installation with the adodb_time functions, and changed the relevant date functions in field_timestamp.inc.
What to do to be able to use dates before 1970 in timestamp fields and have them displayed correctly?
Thanks.
Comments
Comment #1
magnestyuk commentedI rechecked and if I submit dates before 1970, the data is not inserted into the database, with or without the adodb_ functions.
Why the trip_search pages return the submitted dates correctly I have no idea of...
Comment #2
dtan commentedunix timestamps are integers based on the epoch which Jan 1, 1970, meaning that if you represent a date by 0, you will get the epoch. Anything before will be negative. As I see it there are 2 options, rewrite the flexinode_timestamp.inc to function with older dates (maybe serialize the data like profile.module does?), or create a new field type altogether.
Comment #3
samwilson commentedHas there been any progress on this, do you know? I need to be able to put in dates that go back to about 1615…
Comment #4
Bèr Kessels commentedplease provide a patch for this.
Comment #5
sjs commentedI solved the problem in 4.7 by butting adodb date library at includes/; setting "alter table flexinode_data MODIFY numeric_data BIGINT DEFAULT 0 NOT NULL;", and making some changes to field_timestamp.inc and includes/common.inc (see the included svn diff)
Comment #6
Bèr Kessels commentedYour code is very unsafe. It allows SQL injection!