AutoHotkey Community

It is currently May 27th, 2012, 4:51 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: date cmd
PostPosted: October 6th, 2005, 9:19 am 
Offline

Joined: October 4th, 2005, 5:39 pm
Posts: 32
:?:I am looking for a command which will give the date in my computer to a variable and later I want to change the date.

thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2005, 10:20 am 
A_Now


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2005, 12:11 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
To change the date or time, here are a couple of topics:
http://www.autohotkey.com/forum/viewtopic.php?t=3413
http://www.autohotkey.com/forum/viewtopic.php?t=2773

And here's a script by Garry to change the time:
Code:
InputBox,TIME,Send Time to DOS,HH:MM
if ErrorLevel <> 0
    ExitApp
Run %COMSPEC% /C time %TIME%,,hide
ExitApp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2005, 5:29 pm 
Offline

Joined: September 7th, 2004, 9:20 pm
Posts: 275
Location: France
An a little but (I think, of course) util procedure and function : date util
You can see in it tue usage of the FormatTime command.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2005, 6:47 pm 
Offline

Joined: October 4th, 2005, 5:39 pm
Posts: 32
Chris wrote:
To change the date or time, here are a couple of topics:
http://www.autohotkey.com/forum/viewtopic.php?t=3413
http://www.autohotkey.com/forum/viewtopic.php?t=2773

And here's a script by Garry to change the time:
Code:
InputBox,TIME,Send Time to DOS,HH:MM
if ErrorLevel <> 0
    ExitApp
Run %COMSPEC% /C time %TIME%,,hide
ExitApp


it is working very good , thanks.
I still need the cmd which assign the date to a varibale.

_________________
thanks

WIN XP PRO


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2005, 7:14 pm 
Quote:
I still need the cmd which assign the date to a varibale
Two options:
a) you don't read the help
b) you don't read the answers/posts to your request

A_Now (already posted Thu Oct 06, 2005 10:20 am)


Report this post
Top
  
Reply with quote  
 Post subject: How to use it?
PostPosted: October 6th, 2005, 8:29 pm 
Offline

Joined: October 4th, 2005, 5:39 pm
Posts: 32
I fail using the A_NOW.
I try "my_var = A_NOW"
"Run %COMSPEC% /C date %my_var%,,hide "
but it is not working .
Where is my mistake?

_________________
thanks

WIN XP PRO


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: How to use it?
PostPosted: October 6th, 2005, 8:50 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
sgeva2001 wrote:
I try "my_var = A_NOW"
Do: my_var = %A_Now% (see here).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2005, 10:12 pm 
Offline

Joined: September 7th, 2004, 9:20 pm
Posts: 275
Location: France
try :
Code:
FormatTime, TheDate,, ShortDate
msgbox %TheDate%


Report this post
Top
 Profile  
Reply with quote  
 Post subject: The correct way for me
PostPosted: October 7th, 2005, 9:05 am 
Offline

Joined: October 4th, 2005, 5:39 pm
Posts: 32
I tried "my_var = %A-NOW% but it did not work.
I tried "FormatTime, my_var,, ShortDate " and it is working!!!

_________________
thanks

WIN XP PRO


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 7th, 2005, 11:48 am 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2249
Location: switzerland
Code:
H:=A_NOW
msgbox,%H%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 7th, 2005, 12:26 pm 
Code:
I fail using the A_NOW.
I try "my_var = A_NOW"
"Run %COMSPEC% /C date %my_var%,,hide "
but it is not working
Of course.
Two errors:

a)
wrong: my_var = A_NOW
correct: my_var = %A_NOW%
also correct: my_var := A_NOW
b)
DOS's date command expects an date input which is different to the datestamp format which is delivered via AHK's A_Now var. Check the help for further details.

AHK's FormatTime does exactly what's expected, it takes AHK's date format and converts/shrinks it the way you need it.

RTFM.


Report this post
Top
  
Reply with quote  
 Post subject: VERY STARNGE
PostPosted: October 7th, 2005, 4:45 pm 
Offline

Joined: October 4th, 2005, 5:39 pm
Posts: 32
I run this simple script:
"FormatTime, TheDate,, ShortDate
Run %COMSPEC% /C date %TheDate%,,hide "

What happen is that every time I activate it , it cause excahnge of day and month:
first run : the result is that the date in the computer became 10/07/2005
second run:the result is that the date became 07/10/2005
third time: the result is that the date became 10/07/2005
and so on..
what is the problem? why it does not keep the same date?

_________________
thanks

WIN XP PRO


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 7th, 2005, 4:54 pm 
What are your OS's default regional settings regarding date/time?
a) DD/MM/YYYY
b) MM/DD/YYYY


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 7th, 2005, 5:02 pm 
Offline

Joined: October 4th, 2005, 5:39 pm
Posts: 32
a) DD/MM/YYYY

_________________
thanks

WIN XP PRO


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, Google Feedfetcher, Yahoo [Bot] and 67 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group