EO objects for date/time manipulations.
To get current time:
QQ.dt.now > t
To make time from absolute value in nano-seconds after Epoch:
QQ.dt.time > t
1656855443000000
To make short time interval:
QQ.dt.nanosecond.mul 10 > ten-ns
QQ.dt.microsecond.mul 50 > fifty-mcs
QQ.dt.millisecond.mul 100 > hundred-ms
QQ.dt.second.mul 3 > three-seconds
QQ.dt.minute.mul 4 > four-minutes
QQ.dt.hour.mul 5 > five-hours
QQ.dt.day > one-day
QQ.dt.week.mul 2 > two-weeks
To print it in ISO 8601 format using strftime:
QQ.io.stdout
QQ.txt.sprintf
"Current time is %s"
QQ.dt.strftime
"%Y-%m-%dT%H:%M:%S%z"
t
To parse ISO 8601 back to time using strptime:
QQ.dt.strptime > t
"%Y-%m-%dT%H:%M:%S%z"
"2022-07-03T20:26:09+0300"
The object QQ.dt.time
has the following attributes:
plus
adds two timesminus
subtractseq
comparesgt
is TRUE if greater thangte
if greater than or equallt
if less thanlte
if less than or equal
For example, to add five hours and thirty minutes to the current time and then compare it with the time of file creation:
QQ.io.stdout
if.
gt.
plus.
QQ.dt.now
QQ.dt.hour.mul 5
QQ.dt.minute.mul 30
utime.
QQ.fs.file
"test.txt"
"The file is too old"
"The file is fresh"
There are two objects that are aware of calendar specifics and must be used on the left side of the equation in order to respect the calendar. The following code will move current time three months ahead:
plus
QQ.dt.month.mul 3
QQ.dt.now
Fork repository, make changes, send us a pull request.
We will review your changes and apply them to the master
branch shortly,
provided they don't violate our quality standards. To avoid frustration,
before sending us your pull request please run full Maven build:
$ mvn clean install -Pqulice
You will need Maven 3.3+ and Java 8+.