Why am I getting this error executing DateDiff function?
Why am I getting this error executing DateDiff function?
-
- Posts: 34
- Joined: 07 Mar 2024, 06:50
Re: Why am I getting this error executing DateDiff function?
Datediff needs date-time stamps in the YYYYMMDDHH24MISS format. Your picture of the error message shows what you got instead.
Why not use
https://www.autohotkey.com/docs/v2/lib/FormatTime.htm#Parameters wrote:Format
Type: String
If blank or omitted, it defaults to the time followed by the long date, both of which will be formatted according to the current user's locale. For example: 4:55 PM Saturday, November 27, 2004
[...]
Why not use
Code: Select all
time1 := A_Now
Sleep(2000)
time2 := A_Now
MsgBox DateDiff(time1, time2, 'Seconds')
Re: Why am I getting this error executing DateDiff function?
btw, it is recommended to post code in a codebox instead of a picture. That way, people can easily test your code.
Who is online
Users browsing this forum: Google [Bot], MagEpub and 22 guests