 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
kapege.de
Joined: 07 Feb 2005 Posts: 188 Location: Munich, Germany
|
Posted: Tue Mar 01, 2005 12:59 pm Post subject: Unix-Date |
|
|
Could you add a unix date function for date calculations? I would think about a func. something like UDATE, inDate, outDate, 1/0
With "OutDate" are the seconds in Unix-Time when third param is 1 and
vice versa if third param is 0.
So I could something like this:
| Code: |
now = %time%
mFile = %A_FileTime%
udate, now , uNow, 1
udate, mFile, umFile, 1
uAge := umFile - uNow
udate, uAge, age, 0
msgbox, % the file is age old
|
Would that be possible?
Many thanx
Peter
P.S.: "ClipboardAll" is great stuff! |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Tue Mar 01, 2005 11:09 pm Post subject: |
|
|
I think you can already do this with something like: | Code: | FileSelectFile, File
if File =
return
FileGetTime, Time, %File%
FileAge = ; Start off blank.
FileAge -= Time, seconds ; Find precise difference between "now" and "then".
FileAge /= 3600.0 ; Convert to hours as a floating point result.
MsgBox The file is %FileAge% hours old. | If the above doesn't do everything you want, please let me know. |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Mar 02, 2005 9:49 am Post subject: |
|
|
Thanx Chris for your prompt answer!
The code sniplet was just for explanation. I'm working further on my CopyCat-script and are planning a expected-time-out-display.
E.g.:
12Sec./25 Min. (ready at 18:25)
O.k. it could be made with your calculations, but with such a function it would be much more easy (and faster?).
It was just an idea, perhaps I'm working often with time-outs and thought others would be also.
Thanx for all your great stuff!
Peter |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|