cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Compare two datetime values

0 Likes
1,258

Hello everyone,

I have a scenario where I need to compare (two datetime entity values) | (datetime entity with api response date), is it currently possible? Maybe there are helpers like for date formating https://help.sap.com/viewer/a4522a393d2b4643812b7caadfe90c18/latest/en-US/b4f08a9a66434327a405b69348... ?

Thank you!

Best Regards,

Artem

View Entire Topic
JonasB
Advisor
Advisor

Hi Artem,

another option would be to use the "formatDate" helper to convert the dates to a unix millisecond timestamp and then compare those numeric values with the greater than or lower than helpers:

{{#gt (formatDate "01-31-2020" "x") (formatDate "01-30-2020" "x") }}
...
{{/gt}}

Regards
Jonas

JonasB
Advisor
Advisor
0 Likes

By the way: To get the current timestamp, you can use the formatDate helper without providing a date. So if I understand your requirement correctly, it would look like this

{{#gt (formatDate memory.myDateVar "x") (formatDate "x") }}
...
{{/gt}}
0 Likes

Hi Jonas,

It is what I need! Thank you!

Best Regards,

Artem