mIRC Home    About    Download    Register    News    Help

Topic Options
#235150 - 25/11/11 10:05 AM Return creation date of a dll file.
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
I trying to use this code to get creation date of a dll file
Code:
//echo -a $asctime($file($mircdirscripts\system files\dlls\dcx.dll).ctime,dd/mm/yy hh:nn tt)


and it return 26/09/11 06:04 pm

but if i read the properties of the file i get the information

26 September 2011, 7:04:54 pm, as you see the code return the wrong information (the time), how can i correct this?
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#235153 - 25/11/11 12:34 PM Re: Return creation date of a dll file. [Re: sparta]
TRT Offline
Babel fish

Registered: 22/06/03
Posts: 81
I think what happens is that Windows Explorer is aware that you were on daylight saving when the file was created and adjusts the time accordingly.

Maybe this fuctionality could be added with an additional switch.


Edited by TRT (25/11/11 02:27 PM)
_________________________
My full script pieces: (COM addons)

Top
#235154 - 25/11/11 02:27 PM Re: Return creation date of a dll file. [Re: TRT]
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
the properties of the file come from the same explorer (windows), shouldn't mirc return the same information? same file, same windows?
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#235157 - 25/11/11 05:46 PM Re: Return creation date of a dll file. [Re: sparta]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
The date/time being shown in Windows *may* be set to not use DST and is then displayed in Windows using DST. mIRC would show what it's actually set to. You might try viewing the file's properties from the command prompt and see what it shows there. Windows shouldn't be fiddling with anything that you see there.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#235160 - 25/11/11 07:07 PM Re: Return creation date of a dll file. [Re: Riamus2]
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
I noticed a problem, it return the same time for all dll files i using, this cant be right.. smirk and i dont know any other way to grab that info from the dill files, i load them to a dialog together with my remote/aliases files, and i show some info about them. and this is the reason i want the creation date from the file, same with modification date, it also give me the wrong information, any other way then my code i can use to retrieve this information?
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#235162 - 25/11/11 08:15 PM Re: Return creation date of a dll file. [Re: sparta]
TRT Offline
Babel fish

Registered: 22/06/03
Posts: 81
You probably used some simple file archiving or backup program that didn't bother with keeping the original creation time.
I suggest you stick to version numbers: they are easier to compare and won't get changed by accident.
_________________________
My full script pieces: (COM addons)

Top
#235176 - 26/11/11 06:21 AM Re: Return creation date of a dll file. [Re: TRT]
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
No backup program at all, so no changes in files since i unrared them.
_________________________
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Top
#235181 - 26/11/11 01:51 PM Re: Return creation date of a dll file. [Re: sparta]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
If you had verified the DST issue mentioned, you'd already have your answer. Saying they all show the "same time" is misleading. You are getting 1 hour difference on all of them. That is what you should be saying. I just went through and verified this for you. Turning off automatic DST in Windows shows the same time in mIRC and in Windows. This is what you were told right at the start.

Windows is apparently setting the time information incorrectly. This may be an issue when decompressing it because it doesn't happen if I manually create a file. In any case, the time Windows shows is being calculated based on your DST settings and that's causing the problem. Turn off automatic DST and it will probably work just fine. But that isn't the best solution for you if you're distributing the script. Instead, just accept the hour difference or add 1 hour to your time using the script as long as the time shows the same for everyone. There is also a $daylight identifier that can be used, though it doesn't help right now because DST is not in effect right now. Or just get one of the utilities available that let you manipulate the file creation time/date and fix it there. Then make sure it shows correctly with DST enabled and disabled.

You'll probably notice that it shows the right time when DST starts back up. This isn't mIRC's fault because mIRC doesn't use DST at all unless you make use of $daylight. It's an issue in Windows and disabling automatic DST shows that.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top