mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2004
Posts: 4
B
Boost Offline OP
Self-satisified door
OP Offline
Self-satisified door
B
Joined: Dec 2004
Posts: 4
Hi there..

I have this date: 38324.931869

Which is the number of dates since 30 dec 1899.
In vbs I can do this "cdate(38324.931869)" and get the right format, which is: "03-12-2004 22:21:53"

But do do I convert this date i mIRC ?

More info on: Microsoft MSDN


Thx

Boost

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
38324.931869
date: $date($calc((38324 - 25569) * 60*60*24),dd-mm-yyyy)
--> brown is number of days since 30/12/1899; 25569 is number of days between then and 01/01/1970
time: $time($int($calc(.931869 * 60*60*24)))
--> purple is fraction of day, multiply it with number of seconds per day to get seconds

or combined in an alias:
; usage $msdate(38324.931869) for 03-12-2004 22:21:53
; or $msdate(38324.931869).ctime for 1102112513
alias msdate {
if ($1 !isnum) return ERROR: no date supplied
if ($1 !isnum 25569-) return ERROR: dates before 01/01/1970 cannot be converted
if ($prop == ctime) return $int($calc(($1 - 25569) * 86400))
return $date($int($calc(($1 - 25569) * 86400)),dd-mm-yyyy HH:nn:ss)
}


Have fun with it!

Joined: Dec 2004
Posts: 4
B
Boost Offline OP
Self-satisified door
OP Offline
Self-satisified door
B
Joined: Dec 2004
Posts: 4
Thx alot !!!!

That works really well.. smile

However it is 1 hour ahead. Probably because of summer/winter time.

EDIT:

And $daylight returns 0.

Now I'm from Denmark so I don't know how $daylight determines if daylight saving is on or off.

EDIT2:

using $timezone fixed it.
Thx again

Last edited by Boost; 04/12/04 04:49 PM.

Link Copied to Clipboard