Jump to content

Date and time is not with system format


ur
 Share

Recommended Posts

To get the current time stamp, I got the below code.

#include <Date.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
#RequireAdmin
; Under Vista the Windows API "SetSystemTime" may be rejected due to system security
$td = _Date_Time_GetSystemTime()
$td = _Date_Time_SystemTimeToDateTimeStr($td)
$td = StringReplace($td, " ", "_")
$td = StringReplace($td, ":", "_")
MsgBox(0,"",$td)

But it is not giving the date or time of the timezone where the system is there.

Please suggestt

Link to comment
Share on other sites

2 minutes ago, jguinch said:
ConsoleWrite(@MON & "/" & @MDAY & "/" & @YEAR & "_" & @HOUR & "_" & @MIN & "_" & @SEC)

 

THanks @jguinch

But in the meanwhile I have replaced my code with the below one.

Func TodayDateTime()
    $td = _DateTimeFormat(_NowCalc(), 0)
    $td = StringReplace($td, " ", "_")
    $td = StringReplace($td, ":", "-")
    return $td
EndFunc

 

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

×
×
  • Create New...