Converting timestamp to seconds...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
DynamiteHost
Forum Commoner
Posts: 69
Joined: Sat Aug 10, 2002 5:33 pm

Converting timestamp to seconds...

Post by DynamiteHost »

I need to convert a standard mysql 14 character timestamp to seconds.

Anyone know how to do this?

Thanks, any help is appreciated :)
User avatar
gotDNS
Forum Contributor
Posts: 217
Joined: Tue May 07, 2002 5:53 pm
Location: West Chester, PA

Post by gotDNS »

I suppose you could just figure out what each part of the timestamp represent....(i forget)....then multiply by the appropraite numbers (216000?) to get it into second...
fatalcure
Forum Contributor
Posts: 141
Joined: Thu Jul 04, 2002 12:57 pm
Contact:

Post by fatalcure »

isnt a timestamp already in seconds?

try strtotime($timestamp);
daemorhedron
Forum Commoner
Posts: 52
Joined: Tue Jul 23, 2002 11:03 am

Post by daemorhedron »

Take your pick from the numerous selections :

http://www.zend.com/codex.php?CID=348

HTH
Post Reply