Converting Dates...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux