-
Notifications
You must be signed in to change notification settings - Fork 8
dateTimeDiff
David McCartney edited this page Jul 3, 2022
·
4 revisions
Purpose: Gets the difference between two Unix/Julian Datetimes.
Syntax: dateTimeDiff {Difference} {StartDateTime} {EndDateTime} [DatePart]
{Difference}: The name of the var to hold the difference between the two DateTimes. {StartDateTime}: The starting Unix/Julian DateTime to be compared. {EndDateTime}: The endinging Unix/Julian DateTime to be compared. [DatePart]: OPtionally specify which part of the date you want ("Days","Hours","Mins","Secs")
Notes: You can obtain a Unix/Julian DateTime from getDateTime and Store it for later use.
Example:
# Get the Unix/Julian DateTime and save it.
getDateTime $Start
saveVar $Start
# At a later time load the previos $Start DateTime,
# and a get a new $End DateTime.
saveVar $Start
getDateTime $End
# Compare the two DateTimes, returns 'dd:hh:mm:ss'.
dateTimeDiff $Diff $Start $End
echo $Diff "*"
# You can also specify the part of the date you want.
dateTimeDiff $Diff $Start $End "Days"
echo $Diff "*"
dateTimeDiff $Diff $Start $End "Hours"
echo $Diff "*"
dateTimeDiff $Diff $Start $End "Mins"
echo $Diff "*"
dateTimeDiff $Diff $Start $End "Secs"
echo $Diff "*"
.