Diana (Cda) Posted September 27, 2007 Share Posted September 27, 2007 I found _NowTime() in the help file but it gives the exact format seen in regional settings. Unfortunately, filenames won't take colons ":" so was hoping to change the script to give me results that will work in filenames. ; ; AutoIt v3.0 ; SoundPlay (@ScriptDir & "\WAVS\Robotz Menu Popup.wav") #include <date.au3> $thisday = StringMid("Sn,Mn,Tu,Wd,Th,Fr,Sa", StringInStr("SunMonTueWedThuFriSat", _DateDayOfWeek(@WDAY,1) ), 2) ClipPut(@YEAR & '.' & @MON & '.' & @MDAY & '.' & $thisday & ", " & _NowTime()) Sleep(500) Exit ; finished This gives me this type of format in the time part: 16:47 Is there a way to get it instead to show up as 16h47, in 24-hour format with an "h" as separator instead of ":" (as per the French system)? Thanks. Link to comment Share on other sites More sharing options...
james3mg Posted September 27, 2007 Share Posted September 27, 2007 I found _NowTime() in the help file but it gives the exact format seen in regional settings. Unfortunately, filenames won't take colons ":" so was hoping to change the script to give me results that will work in filenames. ; ; AutoIt v3.0 ; SoundPlay (@ScriptDir & "\WAVS\Robotz Menu Popup.wav") #include <date.au3> $thisday = StringMid("Sn,Mn,Tu,Wd,Th,Fr,Sa", StringInStr("SunMonTueWedThuFriSat", _DateDayOfWeek(@WDAY,1) ), 2) ClipPut(@YEAR & '.' & @MON & '.' & @MDAY & '.' & $thisday & ", " & _NowTime()) Sleep(500) Exit ; finished This gives me this type of format in the time part: 16:47 Is there a way to get it instead to show up as 16h47, in 24-hour format with an "h" as separator instead of ":" (as per the French system)? Thanks. StringReplace("16:47",":","h")? That's the easy way... "There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110 Link to comment Share on other sites More sharing options...
Developers Jos Posted September 27, 2007 Developers Share Posted September 27, 2007 - or simply use @Hour & "h" & @Min 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...
Diana (Cda) Posted September 28, 2007 Author Share Posted September 28, 2007 - or simply use @Hour & "h" & @MinOh, man, that's embarrassing. How simple. And yet I looked and looked in the help file <lol>. Well, it's a great script now. Here is what it looks like: ; ; AutoIt v3.0 ; SoundPlay (@ScriptDir & "\WAVS\Robotz Menu Popup.wav") #include <date.au3> $thisday = StringMid("Sn,Mn,Tu,Wd,Th,Fr,Sa", StringInStr("SunMonTueWedThuFriSat", _DateDayOfWeek(@WDAY,1) ), 2) ClipPut(@YEAR & '.' & @MON & '.' & @MDAY & '.' & $thisday & ", " & @Hour & "h" & @Min) Exit ; finished So whenever I need to append the date/time to any backup files I have, I used a compiled version of this script and I name files/folders with the resulting text string and this date/time format keeps them all properly sorted. Thanks! 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