Jump to content

Wrong date getting returned in _Date_Time_GetLocalTime() call.


Recommended Posts

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 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

I get date / time in this format:

04/16/2012 19:54:42
What do you get?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

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.

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...