graydwarf Posted April 16, 2012 Posted April 16, 2012 My local time is 11:02pm on 4/15/2012 but I'm getting back 04/16/2012. Any ideas? Local $tDate = _Date_Time_GetLocalTime() Return _Date_Time_SystemTimeToDateStr($tDate)
water Posted April 16, 2012 Posted April 16, 2012 I get the correct date/time when I run this reproducer script:#include <Date.au3> Local $tDate = _Date_Time_GetLocalTime() ConsoleWrite(_Date_Time_SystemTimeToDateTimeStr($tDate) & @CRLF) What version of AutoIt do you use? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
graydwarf Posted April 16, 2012 Author Posted April 16, 2012 3.3.6.1 It's correct for most of the day but after 6pm (ish), it's giving me the next day.
water Posted April 16, 2012 Posted April 16, 2012 I get date / time in this format: 04/16/2012 19:54:42What do you get? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
graydwarf Posted April 16, 2012 Author Posted April 16, 2012 With this: #include <Date.au3> ConsoleWrite(Common_GetSystemDate() & @CRLF) Func Common_GetSystemDate() Local $tDate = _Date_Time_GetLocalTime() Return _Date_Time_SystemTimeToDateStr($tDate) EndFunc I get this: 04/16/2012 +>12:28:51 AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 1.523 I'm doubting myself now. I may not have saved my common.au3 file correctly so I could have been using GetSystemDate. When I first ran into the problem, I switched over to GetLocalDate but the problem remained. If I failed to save correctly, that could be the problem. Guess I'll try the reduced repro this evening around 6pm and see what happens.
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