anixon Posted November 29, 2006 Posted November 29, 2006 I have probably invested about 4 hours using Help trying to get a dd/mm/yyyy formated date so please be patient I'm still learning.....My routine is:#include <Date.au3>$file = FileOpen(@scriptdir & "\VMonitorLog.txt", 9) FileWriteLine($file, "Successful Autostart " & _DateTimeFormat( _NowCalc(),0))FileClose($file)It gives me in the following notation in the log file:Successful Autostart 11/29/2006 12:54:30 PMThe date format I want to achieve isSuccessful Autostart 29/11/2006 12:54:30 PM Ant
Guest JRowe_1 Posted November 29, 2006 Posted November 29, 2006 (edited) Check out the Date and Time macros in the help files. What you'd want then, is something like... $myDateString = "" & @MDAY &"/"& @MON & "/" & @YEAR & " - " & @HOUR& ":" & @MIN & ":" & @SEC & ""oÝ÷ Ù:-zËcºËkº{aÉb¶Ù^±Êâ¦Ö®¶sbb33c¶×FFU7G&ærÒgV÷C²gV÷C²fײÔDfײgV÷C²ògV÷C²fײÔôâfײgV÷C²ògV÷C²fײT"fײgV÷C²ÒgV÷C²fײõU"fײgV÷C³¢gV÷C²fײÔâfײgV÷C³¢gV÷C²fײ4T2fײgV÷C²gV÷C°¤×6t&÷ÂgV÷C·FW7BgV÷C²Âb33c¶×FFU7G&ær Edited November 29, 2006 by JRowe_1
mikehunt114 Posted November 29, 2006 Posted November 29, 2006 $file = FileOpen(@scriptdir & "\VMonitorLog.txt", 9) FileWriteLine($file, "Successful Autostart " & @MDAY & "/" & @MON & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC) FileClose($file) The clock is in 24 hour format, I'm sure you can figure out how to change it if you want. IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
herewasplato Posted November 29, 2006 Posted November 29, 2006 Did I get the am/pm right?Dim $hh, $ap If @HOUR < 13 Then $hh = @HOUR Else $hh = (@HOUR - 12) EndIf If @HOUR < 12 Then $ap = "AM" Else $ap = "PM" EndIf MsgBox(0, "", @MDAY & "/" & @MON & "/" & @YEAR & " " & $hh & ":" & @MIN & ":" & @SEC & " " & $ap) [size="1"][font="Arial"].[u].[/u][/font][/size]
xcal Posted November 29, 2006 Posted November 29, 2006 Oh I want to play, too! #include <date.au3> $dtformat = _DateTimeFormat( _NowCalc(),0) $dtformat = StringTrimLeft($dtformat, StringInStr($dtformat, '/', 0, 2) - 1) MsgBox(0, '', @MDAY & '/' & @MON & $dtformat) How To Ask Questions The Smart Way
herewasplato Posted November 29, 2006 Posted November 29, 2006 Oh I want to play, too!......but that was the easy way :-) [size="1"][font="Arial"].[u].[/u][/font][/size]
anixon Posted November 29, 2006 Author Posted November 29, 2006 $file = FileOpen(@scriptdir & "\VMonitorLog.txt", 9) FileWriteLine($file, "Successful Autostart " & @MDAY & "/" & @MON & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC) FileClose($file) The clock is in 24 hour format, I'm sure you can figure out how to change it if you want. Thank you very much for your help it works just fine. For some whilst Help is very helpful on understanding some things is not always that obvious. So much to learn so little time. Promise not to ask that question again...... Cheers Ant
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