NassauSky Posted March 24 Share Posted March 24 (edited) Why are things that seem so simple sometimes throw curveballs? #include <Date.au3> Global $nTime = _NowCalc() Global $sLastLogTime = _DateTimeFormat($nTime, "MM/dd/yyyy HH:mm:ss") ConsoleWrite("--$sLastLogTime: " & $sLastLogTime & @CRLF) Isn't $sLastLogTime supposed to display something like 12/22/2023 09:00:00? Edited March 24 by NassauSky Link to comment Share on other sites More sharing options...
water Posted March 24 Share Posted March 24 Parameter 2 of _DateTimeFormat isn't used in the correct way. Please have a look at the help file and you will understand what I'm talking about NassauSky 1 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 Link to comment Share on other sites More sharing options...
Solution Musashi Posted March 24 Solution Share Posted March 24 This would be correct : #include <Date.au3> Global $nTime = _NowCalc() Global $sLastLogTime = _DateTimeFormat($nTime, 0) ConsoleWrite("--$sLastLogTime: " & $sLastLogTime & @CRLF) NassauSky 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
NassauSky Posted March 24 Author Share Posted March 24 (edited) Thanks @water @Musashi for the smelling salt. Old code which I thought was functioning in the past. Edited March 24 by NassauSky Link to comment Share on other sites More sharing options...
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