PHP timestamp

C++, C#, Java, PHP, ect...
Post Reply
Com4dor
Posts: 12
Joined: Sat Apr 19, 2014 10:46 pm

PHP timestamp

Post by Com4dor »

I need to convert "09.Feb.2014 - 05:27 pm" to a timestamp to get the days since. Is there Any way to do this?
Just follow your arrow wherever it points
Sim
Posts: 410
Joined: Sat Dec 26, 2009 5:37 pm

Re: PHP timestamp

Post by Sim »

I believe what your looking for is the function "strtotime()"
oRPG Creator - Make Your Own Browser Game
oRPG Creator on Facebook
Com4dor
Posts: 12
Joined: Sat Apr 19, 2014 10:46 pm

Re: PHP timestamp

Post by Com4dor »

I tried that it didn't work.
Just follow your arrow wherever it points
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: PHP timestamp

Post by Jackolantern »

You may have to do some string manipulation to get it in an acceptable format. That is kind of a strange format there for PHP datetimes.
The indelible lord of tl;dr
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: PHP timestamp

Post by KyleMassacre »

Take a look at this comment from the manual
http://php.net/manual/en/function.strtotime.php#100144
Post Reply

Return to “Coding”