add date function
This commit is contained in:
parent
5ba0c5a215
commit
e851dc5c3c
15
func.ahk
15
func.ahk
@ -12,7 +12,7 @@ GetDateTime(lang)
|
|||||||
UTCTimestamp := A_NowUTC ; Grab the current time and date
|
UTCTimestamp := A_NowUTC ; Grab the current time and date
|
||||||
UTCFormatStr := "yyyy-MM-dd" ; The Date
|
UTCFormatStr := "yyyy-MM-dd" ; The Date
|
||||||
FormatTime, DateStr, %UTCTimestamp%, %UTCFormatStr% ; format it to make it look like the Date we want
|
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
|
FormatTime, TimeStr, %UTCTimestamp%, %UTCFormatStr% ; Format the string to be better
|
||||||
if (lang = "en")
|
if (lang = "en")
|
||||||
{
|
{
|
||||||
@ -23,6 +23,16 @@ GetDateTime(lang)
|
|||||||
{
|
{
|
||||||
Return DateStr " um " TimeStr
|
Return DateStr " um " TimeStr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lang = "ISO8601")
|
||||||
|
{
|
||||||
|
Return DateStr "T" TimeStr
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lang = "date")
|
||||||
|
{
|
||||||
|
Return DateStr
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GetInfo(xID)
|
GetInfo(xID)
|
||||||
@ -104,8 +114,7 @@ ini_write(location, inKey, inValue)
|
|||||||
replacement := inKey . "=" . inValue
|
replacement := inKey . "=" . inValue
|
||||||
tempini := RegExReplace(tempini, needle, replacement,, 1)
|
tempini := RegExReplace(tempini, needle, replacement,, 1)
|
||||||
tempini := RegExReplace(tempini, "\R+\R", "`r`n")
|
tempini := RegExReplace(tempini, "\R+\R", "`r`n")
|
||||||
WinWaitNotActive, GloVar.ini
|
|
||||||
FileAppend, %tempini%, tempini ; Append the fixed ini to a new file
|
FileAppend, %tempini%, tempini ; Append the fixed ini to a new file
|
||||||
FileCopy, tempini, %location%, 1 ; Copy the file over, overwriting existing contents
|
FileCopy, tempini, %location%, 1 ; Copy the file over, overwriting existing contents
|
||||||
FileDelete, tempini ; Delete the fixed temporary ini
|
FileDelete, tempini ; Delete the fixed temporary ini
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user