mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2004
Posts: 40
B
bog__ Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Dec 2004
Posts: 40
so i have problem with creation time
set %lol $file(%mircdir $+ K00005.txt).ctime returns %lol 1184775522

where is date and time in 1184775522 ?
what m i dooing wrong?

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
$asctime(%lol)

set %lol $asctime($file(%mircdir $+ K00005.txt).ctime)

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Most computers store times and dates as a single number - the number of seconds since 1st January 1970 00:00:00. The 1184775522 you're getting means that the file was created 1184775522 seconds after that date.

In order to convert that number into a meaningful time and date you can use mIRC's $asctime() identifier like so:
Code:
$asctime($file(%mircdir $+ K00005.txt).ctime)

You can also customise the formatting of the time and date using $asctime()'s second parameter. Take a look at $asctime in the help file for a description on how to do that.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Dec 2004
Posts: 40
B
bog__ Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Dec 2004
Posts: 40
This shud b in help next to the $file(filename), or i have older version of helpfile ^^, ether way if this isnt in helpfile under $file(filename), then they shud put it there blush
lol hi SladeKraven i remamber you helping me in the past blush like in 2005 wink
ty one more time wink

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I just checked my help file, which is from mIRC 6.21, and it doesn't state that the time returned is measured in seconds, so this might be a good addition, although there are a lot of other things that are missing from the help file as well, and, personally, I feel that this is one of the more minor items.

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
I guess the helpfile entry for $file was assuming the user would look at the entry for $ctime where it states

$ctime(text)

Returns the number of seconds elapsed since 00:00:00 GMT, January 1, 1970 based on the date that you specify

I agree that there are plenty of places the helpfile should be more verbose, but this is rather low on my list.


Link Copied to Clipboard