mIRC Home    About    Download    Register    News    Help

Print Thread
#39784 05/08/03 09:35 AM
Joined: Jun 2003
Posts: 129
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Jun 2003
Posts: 129
$asctime($calc($uptime(mirc) / 1000),hh:nn:ss)
12:53:59
The actual uptime is
02:53:59
Why is there a 1 infront I dont understand.

#39785 05/08/03 01:30 PM
Joined: Feb 2003
Posts: 2,737
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,737
This is because $asctime is suppose to display time/date information based on the number of seconds from Jan 1 1970 00:00 GMT. Since you are in a different timezone, mIRC adds/subtracts hours to $asctime to make up the difference.

You can however use the $gmt function the same as $asctime, and it wont adjust for timezone / daylight savings... however years/months/days are still just as useless for durations.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#39786 06/08/03 05:36 AM
Joined: Dec 2002
Posts: 1,253
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,253
In addition to Raccoon's answer (valid through 31 days), my $ymdhns() works like $duration except that it foregoes weeks, using instead years monthns days hours minutes and seconds.

#39787 06/08/03 11:12 AM
Joined: Jun 2003
Posts: 129
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Jun 2003
Posts: 129
I still dont understand it shows how many minutes are in the seconds specified and shows the reamaining seconds so you would it show something else for hours?

#39788 06/08/03 11:19 AM
Joined: Jun 2003
Posts: 129
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Jun 2003
Posts: 129
heres and exaple:
$time(60,n) returns 1 because there is 1 minute in 60 seconds
$time(3600,h) returns 11 it should return 1?

Last edited by obsessed; 06/08/03 11:19 AM.
#39789 07/08/03 04:06 AM
Joined: Dec 2002
Posts: 1,253
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,253
Use the correct identifier for what you want to do:

$gmt(60,n) returns 1 (minute in 60 seconds)
$gmt(3600,h) returns 1 (hour in 3600 seconds)

#39790 07/08/03 07:42 AM
Joined: Jun 2003
Posts: 129
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Jun 2003
Posts: 129
Oh sorry, I meant to use gmt, but this is still stange, while $gmt(3600,h) does return 1, $gmt(1,h) returns 12.

#39791 07/08/03 10:10 AM
Joined: Dec 2002
Posts: 1,253
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,253
That is correct because a CTime of 1 is Thu Jan 01 12:00:01 1970...one second after midnight on Thursday, January 1st, 1970.

#39792 08/08/03 07:55 AM
Joined: Jun 2003
Posts: 129
O
Vogon poet
OP Offline
Vogon poet
O
Joined: Jun 2003
Posts: 129
Oh now I understand so if I was to use the 24hr format it would show me 0 hrs. Thanx guys smile


Link Copied to Clipboard