Forum Moderators: coopster

Message Too Old, No Replies

Convert seconds after midnight to a date

         

StoutFiles

3:25 pm on Dec 14, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I have an integer of seconds, say 23472, what would be the easiest way to convert this to hours and minutes? Can PHP's date() do this?

ALKateb

11:35 am on Dec 15, 2009 (gmt 0)

10+ Year Member



is this a timestamp? if yes then date() will convert it

date('Y-m-d',23472)

but this is not a timestamp as it wont be that short! but maybe u just gave a number as example while you meant a timestamp right?

if what you have is number of seconds between two timestamps and you want to know hoe many hours are those you can simply divide it by 60! and you will get minutes and by 3600 and you will get hours