Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
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
Posted on 12-06-04 02:01 PM Link | Quote
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
Posted on 12-06-04 09:05 PM Link | Quote
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.
Posted on 12-07-04 05:35 PM Link | Quote
...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
Posted on 12-07-04 05:52 PM Link | Quote
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
Posted on 12-07-04 05:54 PM Link | Quote
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.
Posted on 12-07-04 05:54 PM Link | Quote
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
Posted on 12-08-04 03:51 AM Link | Quote
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.
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
Posted on 12-08-04 04:05 AM Link | Quote
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 | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.009 seconds.