Created
January 8, 2021 10:20
-
-
Save theilgaz/077931e492e645157a79ca7594414217 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetCurrentDateTime:string; | |
var | |
Year, Month, Day, Hour, Min, Sec, MSec: Word; | |
sYear, sMonth, sDay, sHour, sMin, sSec: string; | |
begin | |
DecodeDate(Now, Year, Month, Day); | |
DecodeTime(Now, Hour, Min, Sec, MSec); | |
sYear := Copy(Year.ToString, 3, 2); | |
if Month < 10 then sMonth := '0'+Month.ToString else sMonth := Month.ToString; | |
if Day < 10 then sDay := '0'+Day.ToString else sDay := Day.ToString; | |
if Hour < 10 then sHour := '0'+Hour.ToString else sHour := Hour.ToString; | |
if Min < 10 then sMin := '0'+Min.ToString else sMin := Min.ToString; | |
if Sec < 10 then sSec := '0'+Sec.ToString else sSec := Sec.ToString; | |
//if MSec < 10 then sMSec := '0'+MSec.ToString else sMSec := MSec.ToString; | |
Result := sYear+sMonth+sDay+sHour+sMin+sSec;//+sMSec; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment