-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add functions DT_DATE_NOW and DT_DATE_TODAY #453
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, good idea, but I would like to have some changes before I can merge this.
src/test/java/com/ezylang/evalex/functions/datetime/DateTimeFunctionsTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/ezylang/evalex/functions/datetime/DateTimeFunctionsTest.java
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes required, I will add another PR myself to fix them.
E.g. The renaming of DT_NOW/DT_TODAY is not reflected in documentation, also I would like the MIN/MAX functions throw an exception when parameters are missing, as before.
This PR introduces new
DATE_TIME
functions:DT_DATE_NOW
Produces a new DATE_TIME that represents the current date and time.
It is useful to calculate a value based on the current date and time. For example, if you know the start DATE_TIME of a running process, you might use the following expression to find the DURATION that represents the process age:
DT_DATE_TODAY
Produces a new DATE_TIME that represents the current date, at midnight (00:00), in the system default time zone.
It is useful for DATE_TIME comparison when the current time must not be considered. For example, in the expression:
NOTE: The functions and examples were inspired by well-accepted spreadsheet systems.