Sign in to follow this  
Followers 0
BillCAD

Get System Date/Time

4 posts in this topic

I just discovered AutoIt about a week ago and am very eager to learn more about using it. I had been using WinBatch from about '96 up until 2003 and have done some interesting and unique things with it (for me anyway, "I'm not a programmer but I play one on TV!" :lol: ). Since changing jobs in '03 I have not been responsible for PC/IT stuff anymore so I haven't had to create any gadgets or applets for a while. Recently I was challenged with a situation where an NC program for a Haas mill required to be scaled in the X and Y axis but not Z. The Haas controller does not have the capability of independent axis scaling so I tried to do it in BobCAD (Cad/Cam software used to create the NC programs from solid models), but, to my dismay, BobCAD does not have independent scaling capability either. :mad: My thought was "I could use WinBatch to create an app that would read in the NC file, parse the Z values, scale them and output the program with the altered Z values." :idea: Well the version of WinBatch I was using (WB99) is quite out of date and actually belongs to my previous employer anyway. :P My current employer would not spend the money, especially for the compiler version so I started searching online. For some reason I found myself on the Wikipedia page for WinBatch when I noticed AutoIt in the "See also" section at the bottom of the page. I was so excited to learn that it was exactly what I was looking for (including compiler), and it's FREE. :D I spent a few hours Friday night reading through the FAQs, function reference and assorted notes and info. Sunday around 2:00pm I downloaded AutoIt and started playing with some of the examples and writing code. At 10:45pm I had a working EXE file that would do what I wanted! I have been tweaking it throughout the week and have probably put another 8-10 hours in it, but while it is not completely robust, it is now more intelligent and ready to do the job! :)

OK, enough blowing smoke, there is a question here. How do I get the system date and time? My script renames the original file and recreates a new file under the original name, so I was able to use FileGetTime since the file was just created. Of course there may be situations where I need to retrieve this info without any file manipulation involved. Is there a trick? Thanks for this software AND this forum, I did quite a few searches and got some good answers here. Keep up the good work! :)

Share this post


Link to post
Share on other sites



I just discovered AutoIt about a week ago and am very eager to learn more about using it. I had been using WinBatch from about '96 up until 2003 and have done some interesting and unique things with it (for me anyway, "I'm not a programmer but I play one on TV!" :lol: ). Since changing jobs in '03 I have not been responsible for PC/IT stuff anymore so I haven't had to create any gadgets or applets for a while. Recently I was challenged with a situation where an NC program for a Haas mill required to be scaled in the X and Y axis but not Z. The Haas controller does not have the capability of independent axis scaling so I tried to do it in BobCAD (Cad/Cam software used to create the NC programs from solid models), but, to my dismay, BobCAD does not have independent scaling capability either. :mad: My thought was "I could use WinBatch to create an app that would read in the NC file, parse the Z values, scale them and output the program with the altered Z values." :idea: Well the version of WinBatch I was using (WB99) is quite out of date and actually belongs to my previous employer anyway. :P My current employer would not spend the money, especially for the compiler version so I started searching online. For some reason I found myself on the Wikipedia page for WinBatch when I noticed AutoIt in the "See also" section at the bottom of the page. I was so excited to learn that it was exactly what I was looking for (including compiler), and it's FREE. :D I spent a few hours Friday night reading through the FAQs, function reference and assorted notes and info. Sunday around 2:00pm I downloaded AutoIt and started playing with some of the examples and writing code. At 10:45pm I had a working EXE file that would do what I wanted! I have been tweaking it throughout the week and have probably put another 8-10 hours in it, but while it is not completely robust, it is now more intelligent and ready to do the job! :)

OK, enough blowing smoke, there is a question here. How do I get the system date and time? My script renames the original file and recreates a new file under the original name, so I was able to use FileGetTime since the file was just created. Of course there may be situations where I need to retrieve this info without any file manipulation involved. Is there a trick? Thanks for this software AND this forum, I did quite a few searches and got some good answers here. Keep up the good work! :)

Try this:

#Include <Date.au3>
_Now()

Share this post


Link to post
Share on other sites

There are a couple of macros for this, see "Macro Reference" in the helpfile.@HOUR@MINand more...

BINGO! :P I feel like such a ... well, NEWBIE! :) I had completely ignored the Macros as I didn't think of them as being used in that way, but rather something you have to create to do a task for you. CNC head, I guess. :) Already fixed and tested it! Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0