add date function

This commit is contained in:
David Daily 2022-03-29 14:32:47 -05:00
parent 5ba0c5a215
commit e851dc5c3c

View File

@ -12,7 +12,7 @@ GetDateTime(lang)
UTCTimestamp := A_NowUTC ; Grab the current time and date
UTCFormatStr := "yyyy-MM-dd" ; The Date
FormatTime, DateStr, %UTCTimestamp%, %UTCFormatStr% ; format it to make it look like the Date we want
UTCFormatStr := "H:mm' GMT'" ; The time
UTCFormatStr := "H:mm'Z'" ; The time
FormatTime, TimeStr, %UTCTimestamp%, %UTCFormatStr% ; Format the string to be better
if (lang = "en")
{
@ -23,6 +23,16 @@ GetDateTime(lang)
{
Return DateStr " um " TimeStr
}
if (lang = "ISO8601")
{
Return DateStr "T" TimeStr
}
if (lang = "date")
{
Return DateStr
}
}
GetInfo(xID)
@ -104,7 +114,6 @@ ini_write(location, inKey, inValue)
replacement := inKey . "=" . inValue
tempini := RegExReplace(tempini, needle, replacement,, 1)
tempini := RegExReplace(tempini, "\R+\R", "`r`n")
WinWaitNotActive, GloVar.ini
FileAppend, %tempini%, tempini ; Append the fixed ini to a new file
FileCopy, tempini, %location%, 1 ; Copy the file over, overwriting existing contents
FileDelete, tempini ; Delete the fixed temporary ini