mIRC Home    About    Download    Register    News    Help

Print Thread
$file(mirc.exe).ctime returns creation time #181141 18/07/07 05:34 PM
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?

Re: $file(mirc.exe).ctime returns creation time [Re: bog__] #181142 18/07/07 05:35 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
$asctime(%lol)

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

Re: $file(mirc.exe).ctime returns creation time [Re: bog__] #181143 18/07/07 05:41 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
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.
Re: $file(mirc.exe).ctime returns creation time [Re: SladeKraven] #181146 18/07/07 05:57 PM
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

Re: $file(mirc.exe).ctime returns creation time [Re: bog__] #181161 18/07/07 10:10 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
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.

Re: $file(mirc.exe).ctime returns creation time [Re: RusselB] #181172 19/07/07 03:33 AM
Joined: Jan 2004
Posts: 1,203
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,203
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.