User | Post |
neotransotaku
Posts: 1842/4016 |
You need to use a combination of mktime and date. mktime returns an integer representation of the date and date will return a string based on the format you want the date printed and the result of mktime. Check out PHP documentation for date() |
SyntaxLegend
Posts: 119/222 |
Originally posted by Acmlm 60*60*24
But I'm guessing he meant like this, where it says the days, hours, minutes and seconds
i wanted something similar like that, but i cant figure out how to do it just yet. |
Xkeeper
Posts: -3003/-863 |
That seems like it'd be simple enough, if there was a funcion that would convert it for you (which to my knowledge there isn't)
A date() like funciton for that would be nice... how did you do it, though? |
SyntaxLegend
Posts: 118/222 |
i had made the function. simple enough. function timedays($seconds){ $time=$seconds/86400; return $time; } yeah, i know its shotty. but it does its work. |
Acmlm
Posts: 958/1173 |
60*60*24
But I'm guessing he meant like this, where it says the days, hours, minutes and seconds |
Xkeeper
Posts: -3006/-863 |
...convert seconds into days?
Er.
days = floor( seconds / ( 60 * 60 * 20 ) );
|
neotransotaku
Posts: 1822/4016 |
makes me wonder why you needed to use if to begin with... |
SyntaxLegend
Posts: 115/222 |
Is there a way to convert seconds into days with out using a lot of IF queries. is there a set function?
EDIT: okay, i made my own function. It was simple. It's what happens when you code too early in the morning.... |