About EasyMorph Tutorials & Examples Web-help

Compare timestamps with date

Hi,

If we compare a date (YYYY-MM-DD) for example with a datetime (YYYY-MM-DD HH:MM:SS), will easyMorph do a correct comparison or do we need to extract the date part from the datetime ?

  • Is there a function to extract the date part from the datetime in one operation ?
  • How to create a datetime from a text in EasyMorph ?

Thanks !
Nikolaas

Dates are numbers in EasyMorph. See this tutorial article on data types: https://easymorph.com/learn/expressions.html

There are no dates without times. If a date has no time it means that the time is 12am. Two dates with different times are not equal.

Days are the the integer part of a date. Time is the fractional.

Since a date is a number of days, then extracting a date from a timestamp is basically rounding it to an integer. For instance:

date(floor(43980.6041666667), "yyyy-MMM-dd") //returns 43980 which is 2020-May-29 00:00

Use the date() function. For instance:

date("2020-May-29 14:30", "yyyy-MMM-dd HH:mm") //returns 43980.6041666667

Hi Dmitry,

Thanks.

When I create a column date = today() and I format that column in the format bar a shown below, the value it shows is only the day and not its time part at 00:00:00. Therefore I thought that there was no time part.

image

To learn more about EasyMorph visit easymorph.com.