hi,
I've got a problem regarding a dateformat, and I'm hoping you can help me.
I'm using a great JQuery datepicker script, and I've managed to get the data into my php script, where I want to use it (e.g. store it in the database) but I've got no idea what kind of dateformat it is. I need to get the day, month and year from the datepicker.
when I select a date, the corresponding output is, for example, "Wed Jun 17 2009 00:00:00 GMT+0200 (CEST)". but when all the selected dates are put in an array by the datepicker the output I get is 1245189600000.
I can't find any corresponding numbers in there, does anyone know how to 'unscramble' this?
I've got some more examples for you:
Thu Jun 04 2009 00:00:00 GMT+0200 (CEST) -> 1244066400000
Sat Oct 10 2009 00:00:00 GMT+0200 (CEST) -> 1255125600000
Sun Jan 16 2011 00:00:00 GMT+0100 (CET) -> 1295132400000
I'm really hoping you can help me! thanks in advance,
Hanneke
Date format question
Moderator: General Moderators
-
mattpointblank
- Forum Contributor
- Posts: 304
- Joined: Tue Dec 23, 2008 6:29 am
Re: Date format question
That looks like the output of php's strtotime() function, which turns a string like "14th March 2009" into a single number (it's actually the number of seconds since 1st January 1970).
You could use php's date formatting syntax to produce a custom date like this:
Try it!
You could use php's date formatting syntax to produce a custom date like this:
Code: Select all
$newdate = date("Y-m-d g:i:a", "1245189600000");