AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unix-Date

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
kapege.de



Joined: 07 Feb 2005
Posts: 188
Location: Munich, Germany

PostPosted: Tue Mar 01, 2005 12:59 pm    Post subject: Unix-Date Reply with quote

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
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Tue Mar 01, 2005 11:09 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Guest






PostPosted: Wed Mar 02, 2005 9:49 am    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group