Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
0 user currently in Programming. | 3 guests |
Acmlm's Board - I2 Archive - Programming - PHP Qusestion - Converting Seconds | | | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
User | Post | ||
SyntaxLegend Double metal axe Level: 25 Posts: 115/222 EXP: 78264 For next: 11356 Since: 04-21-04 From: Australia Since last post: 20 days Last activity: 10 hours |
| ||
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.... (edited by SyntaxLegend on 12-06-04 07:06 AM) |
|||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 1822/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
makes me wonder why you needed to use if to begin with... | |||
Xkeeper The required libraries have not been defined. Level: NAN Posts: -3006/-863 EXP: NAN For next: 0 Since: 03-15-04 Since last post: 2 hours Last activity: -753366 sec. |
| ||
...convert seconds into days? Er. days = floor( seconds / ( 60 * 60 * 20 ) ); (edited by Xkeeper on 12-07-04 08:53 AM) |
|||
Acmlm Torosu heh Level: 51 Posts: 958/1173 EXP: 981994 For next: 31944 Since: 03-15-04 From: Somewhere that isn't outside of Sherbrooke, Québec, Canada Since last post: 39 days Last activity: 3 hours |
| ||
60*60*24 But I'm guessing he meant like this, where it says the days, hours, minutes and seconds |
|||
SyntaxLegend Double metal axe Level: 25 Posts: 118/222 EXP: 78264 For next: 11356 Since: 04-21-04 From: Australia Since last post: 20 days Last activity: 10 hours |
| ||
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. |
|||
Xkeeper The required libraries have not been defined. Level: NAN Posts: -3003/-863 EXP: NAN For next: 0 Since: 03-15-04 Since last post: 2 hours Last activity: -753366 sec. |
| ||
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 Double metal axe Level: 25 Posts: 119/222 EXP: 78264 For next: 11356 Since: 04-21-04 From: Australia Since last post: 20 days Last activity: 10 hours |
| ||
Originally posted by Acmlmi wanted something similar like that, but i cant figure out how to do it just yet. |
|||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 1842/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
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() |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
Acmlm's Board - I2 Archive - Programming - PHP Qusestion - Converting Seconds | | | |