krishpun Posted April 6, 2011 Share Posted April 6, 2011 I need to create a file with the file name as system date and time For example: If system date is in the format(dd/mm/yyyy hh:mm:ss), i need to create the file "ddmmyyhhmmss" dynamically Please let me know how can I do this. I have been trying with date functions, and converting them to string etc.... but still no luck. Please help. regards, Krishna Link to comment Share on other sites More sharing options...
wakillon Posted April 6, 2011 Share Posted April 6, 2011 (edited) like this ? #include <Date.au3> ConsoleWrite ( StringRegExpReplace ( _NowCalc(), "(:|/| )", "" ) & @CRLF ) Edit : yyyymmddhhmmss time format is better for sort names by date. Edited April 6, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
r3dbull Posted April 6, 2011 Share Posted April 6, 2011 (edited) Try this: $var=@MDAY&@MON&@YEAR&@HOUR6@MIN&@SEC ConsoleWrite($var & @CRLF) It should work the way you asked. Edited April 6, 2011 by r3dbull Link to comment Share on other sites More sharing options...
krishpun Posted April 6, 2011 Author Share Posted April 6, 2011 Thanks a lot, it works fine now. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now