gcue Posted February 21, 2008 Share Posted February 21, 2008 is it possible to name a filename with the current date and time? (if possible including seconds.) _Date_Time_GetSystemTime() _Date_Time_GetSystemTime() format it with / and : (so cant use those chars in a filename) any ideas? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 21, 2008 Moderators Share Posted February 21, 2008 is it possible to name a filename with the current date and time? (if possible including seconds.)_Date_Time_GetSystemTime()_Date_Time_GetSystemTime()format it with / and : (so cant use those chars in a filename)any ideas?C'mon... use StringReplace... Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
gcue Posted February 21, 2008 Author Share Posted February 21, 2008 lol didnt know that existed.. thanks!C'mon... use StringReplace... Link to comment Share on other sites More sharing options...
Developers Jos Posted February 21, 2008 Developers Share Posted February 21, 2008 is it possible to name a filename with the current date and time? (if possible including seconds.) _Date_Time_GetSystemTime() _Date_Time_GetSystemTime() format it with / and : (so cant use those chars in a filename) any ideas?$filename = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC & ".txt" SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 21, 2008 Moderators Share Posted February 21, 2008 $filename = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC & ".txt" That's how I do it personally... Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
gcue Posted February 21, 2008 Author Share Posted February 21, 2008 perfect!! too bad we cant do 12hour format $filename = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC & ".txt" Link to comment Share on other sites More sharing options...
Developers Jos Posted February 21, 2008 Developers Share Posted February 21, 2008 perfect!!too bad we cant do 12hour formatwhat made you conclude that ? a single If..Then .. Else ... Endif should solve that for you and I am sure you are able to figure it out yourself SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
gcue Posted February 22, 2008 Author Share Posted February 22, 2008 you mean like this? $filename = @HOUR & "." & @MIN & "." & @SEC & "_" & @MON & "-" & @MDAY & "-" & @YEAR If @HOUR="13" Then @HOUR="01" EndIf If @HOUR="14" Then @HOUR="02" EndIf If @HOUR="15" Then @HOUR="03" EndIf etc.... ??? Link to comment Share on other sites More sharing options...
weaponx Posted February 22, 2008 Share Posted February 22, 2008 (edited) $filename = @YEAR & @MON & @MDAY & twelvehour(@HOUR) & @MIN & @SEC & ".txt" Func twelvehour($hour) If $hour >= 12 Then $hour -= 12 Return StringFormat("%02i", $hour) EndFunc MsgBox(0,"",$filename) Edited February 22, 2008 by weaponx Link to comment Share on other sites More sharing options...
gcue Posted February 22, 2008 Author Share Posted February 22, 2008 perfect!! thank you much! Link to comment Share on other sites More sharing options...
weaponx Posted February 22, 2008 Share Posted February 22, 2008 perfect!!thank you much!I don't know what purpose this would serve, you will never know if a file was saved in the AM or PM... Link to comment Share on other sites More sharing options...
gcue Posted February 22, 2008 Author Share Posted February 22, 2008 wed only be using it during hte day time..thanks for the thought thoI don't know what purpose this would serve, you will never know if a file was saved in the AM or PM... 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