Stange Date problem

Status
Not open for further replies.

cytino

New Member
Hi
Probably being thick here but.
I have a calender element with the table format set to - d.m.Y
If for instance i enter 1.6.2008
In the form the date is displayed correctly.
In the database i get

1969-12-31
I am using the latest svn 969
Please help me.

CYTino
 
Ack phfffft. I'm really starting to hate the date code, LOL!

The problem is, we currently use the standard PHP routine strtotime() to process the submitted date, which takes a formatted time string and spits out a UNIX style timestamp, which we can then format back into the MySQL date format for storing in db.

So far so good ... but strtotime() only "understands" a certain subset of the almost infinite ways of formatting a date. And in particular, it can get confused between an m-d-Y and a d-m-Y format, when m and d are both 12 or less.

Much to my surprise, there doesn't seem to be any date handling routine which takes a formatted date string AND a format string, and spits out a timestamp.

So ... really the only solution is that we will have to write one.

For now, can you try something for me, and use m-d-Y instead of d-m-Y, see if that works?

-- hugh
 
Hi #
I tried the following:
m.d.Y and m-d-Y still the same.

I also went back to Y.m.d and also Y-m-d and still get the same strange results?

I am now totally confused.
 
What is the "main problem"?

We think we have resolved the problem, by creating a new function that "reverse engineers" the format you used when submitting the data to the db.

Upgrade to the latest SVN and try again. You should be able to use your original d.m.Y format.

-- hugh
 
The date displays Ok when the date picker element is used, however.
In the database the date and time format are stored as:
1969-12-31 18:00:00

When a form view is used the date is also displayed as:
1969-12-31 18:00:00

The problem is that my users being European cannot get there heads around the US display format.

Please help.

CYTino
 
I think we may finally have gotten dates working properly in the latest SVN. I found a bug which was causing dates to be reset to "start of epoch" (the 1969 date) in certain circumstances.

Try updating to the latest SVN, and see if that fixes things. On my test server, I'm now able to use any date format and it works fine.

-- hugh
 
Hi
I have upgraded to svn 972
the problem is still the same i.e.
If i choose 2008.07.01
It appears in the database and table view as: as as 2008-12-01 00:00:00

I know that this has caused you a major headache but I must keep asking for help as I cannot progress without this.

CYTino
 
Unfortunately my development server just blew a power supply (literally 10 minutes ago), and it's an esoteric external supply for a Dell Optiplex SX260, so I can't run down to Gigaparts and get one.

I'm ordering it for 2 day delivery off the net now, but until it gets here I'm totally without my Fabrik test / dev server. Can't even test your date problem.

-- hugh
 
OK, I'm back on the air, my dev server is up again. We made a few more changes to the date stuff, so if you could upgrade to the latest SVN and let me know if the problem still exists b4 I try and duplicate it ...

-- hugh
 
Status
Not open for further replies.

Members online

No members online now.
Back
Top