Re: [PHP] convert 12:12:00 to seconds
$seconds = explode(:, $time); $seconds = $seconds[0] * 3600 + $seconds[1] * 60 + $seconds[2]; Or use www.php.net/mktime /* Chris Lambert, CTO - [EMAIL PROTECTED] WhiteCrown Networks - More Than White Hats Web Application Security - www.whitecrown.net */ - Original Message - From: nafiseh saberi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 23, 2001 9:30 AM Subject: [PHP] convert 12:12:00 to seconds | | hi. | how do I covert convert 12:12:00 to seconds ? | I want to get time from system and covert it to seconds to do | arithmetic work on it. | thanks. | | -- | PHP General Mailing List (http://www.php.net/) | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | To contact the list administrators, e-mail: [EMAIL PROTECTED] | | | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] convert 12:12:00 to seconds
Use gmmktime() or mktime() example : ?php echo gmmktime(12,12,0,1,1,1970); // format(hour,minute,second,month,day,year) // counting starts from 1/1/1970 so if you set this day you will receive the secongs // gmmktime accoring GMT or mktime() accoring you local time (mine is GMT+3) // so 12:12:00 used with gmmktime will give me how many seconds there are in 9:12:00h ? - Original Message - From: nafiseh saberi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 23, 2001 4:30 PM Subject: [PHP] convert 12:12:00 to seconds hi. how do I covert convert 12:12:00 to seconds ? I want to get time from system and covert it to seconds to do arithmetic work on it. thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] convert 12:12:00 to seconds
maybe $time=12:12:00 $x=explode(:,$time); $sec=($x[0]*3600)+($x[1]*60)=$x[2]; rm --- nafiseh saberi [EMAIL PROTECTED] wrote: hi. how do I covert convert 12:12:00 to seconds ? I want to get time from system and covert it to seconds to do arithmetic work on it. thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]