Converting Dates...
| From: | Doug Coning | Date: | Thu, 06 Mar 2003 02:20:59 +0000 |
| Subject: | Converting Dates... | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-26112@lists.php.net to get a copy of this message | ||
Hi,
I need help. I need to convert a Date column in MySQL where the date is
stored like "2003-01-15" to the following seconds "1042621252 ". I'm
connecting the database through PHP to third party solution that requires
this. Here is the only information that was given:
-------------------------------------------------------------------
- Dates and times are passed in as seconds (not milliseconds) since
1/1/1970
and converted into Date Objects by multiplying by 1000 and then add the
TimeZoneOffset to get it to local time:
eg:
startTime = 10710812; // startTime is the number of seconds between the
req'd date and 1/1/1970
startTimeObj = Date(startTime * 1000 + (new Date().getTimezoneOffset() *
60000));
- startDate and endDate combine the the date and time of events
-----------------------------------------------------------------
I have no idea how to convert my date colums into this type. Any help would
be GREATLY appreciated!
Thanks,
Doug Coning