Jump to content

Date Format


anixon
 Share

Recommended Posts

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 PM

The date format I want to achieve is

Successful Autostart 29/11/2006 12:54:30 PM

;) Ant

Link to comment
Share on other sites

Guest JRowe_1

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 by JRowe_1
Link to comment
Share on other sites

$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]
Link to comment
Share on other sites

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]

Link to comment
Share on other sites

$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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...