View Full Version : Converting Time in PHP
07-02-2007, 11:14 AM
I have an application that gives me numbers like 1183354915 and the php coding converts it into a time.
print date('d m Y', $row['topic_time']);
Are there any converters that will allow me to input July 2, 10:59PM and it will spit out that number?
07-02-2007, 12:01 PM
Yes, you can! I would suggest reading the manual first.. but I mean there are so
many functions so I don't blame you.. anyhow this is how to do it..
$string = "July 2, 10:59PM";
echo strtotime("July 2, 10:59PM");
and forgot output.. this is what it'll output "1183417140" :D
07-02-2007, 07:04 PM
All this does it provides the output of "-1" Am I missing something?
07-03-2007, 10:18 AM
You must be, because it outputs exactly as I put it in both examples.
07-03-2007, 10:35 AM
Just so you no, there is another function quite useful in generating time stamps:
Look it up on php.net
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.