Hi,
below you will find ways to add/minus days in "DateTime" or "Date" Datatype.
Example 1: Days add/minus in "DateTime" Datatype.
{
utcDateTime todayLessOneDay;
// Get the actual UTCDateTime based on the current system
todaysDateTime = DateTimeUtil::utcNow();
// Convert it to a string, just to show in on the info log
info(DateTimeUtil::toStr(todaysDateTime));
// Now less a day
todayLessOneDay = DateTimeUtil::addDays(todaysDateTime, -1);
// And Info it out again
info(DateTimeUtil::toStr(todayLessOneDay));
}
Example 2: Days add/minus in "Date" Datatype.
{
TransDate transDate = today();
;
transDate++;
print transDate - 2;
pause;
}
No comments:
Post a Comment