Jump to content

[SOLVED] Translating DATETIME into TIMESTAMP


woolyg

Recommended Posts

Is there a way to do it in PHP? I just need to run a quick function using TIMESTAMP as opposed to DATETIME..

 

I'm not positive I follow, but if you're simply trying to translate a DATETIME into a unix timestamp, just use strtotime():

<?php
$dt = '2007-10-04 00:00:00';
$ts = strtotime($dt);
if ($ts !== FALSE)
{
  // Success!
  echo "Timestamp = {$ts}";
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.