-3

Please, how i can change date format in php

from something like 2012-12-14 08:40:26

to format number like 28124629523

  • 1
    Any search on Google or Stack Overflow can find this answer. Lucky John only took 9 seconds to answer this. – ntgCleaner Dec 14 '12 at 18:51

1 Answers1

5

FYI, what you're looking for is called a Unix Timestamp

Use strtotime()

echo strtotime('2012-12-14 08:40:26');

or DateTime

$datetime = new DateTime('2012-12-14 08:40:26');
echo $datetime->getTimestamp();
John Conde
  • 217,595
  • 99
  • 455
  • 496