Dealing with dates in an automation can be a bit tricky, mostly because of the format they come with.
For example, the date can be stored in a single string :
![Ionut_Dumitrascu_1-1624447182935.png Ionut_Dumitrascu_1-1624447182935.png](https://community.qlik.com/t5/image/serverpage/image-id/57403i5F1A4A77421B62A6/image-size/medium?v=v2&px=400)
or the information can be stored in different fields like this:
![Ionut_Dumitrascu_0-1624447058480.png Ionut_Dumitrascu_0-1624447058480.png](https://community.qlik.com/t5/image/serverpage/image-id/57402i13D3FA61452E33A2/image-size/medium?v=v2&px=400)
In most cases, the dates that need to be compared have different formats, so the most important thing is to apply the same format to both. An easy way to do this is to use the 'Epoch timestamp conversion' format. To do this, we need to use the 'Date' formula:
![Ionut_Dumitrascu_3-1624447635541.png Ionut_Dumitrascu_3-1624447635541.png](https://community.qlik.com/t5/image/serverpage/image-id/57405i65321636A6EC37F7/image-size/medium?v=v2&px=400)
The formula will have the following format:
![Ionut_Dumitrascu_2-1624447583677.png Ionut_Dumitrascu_2-1624447583677.png](https://community.qlik.com/t5/image/serverpage/image-id/57404i5F44B14B1566FAC6/image-size/medium?v=v2&px=400)
where 'now' can be replaced by any date input and 'Uv' represents the 'Epoch timestamp conversion' format.
This will convert any date into 'Unix timestamp', for example: 'Date and time (GMT): Wednesday, June 23, 2021 11:21:23 AM' will be converted to: 'Timestamp in milliseconds: 1624447283000'.
Now in a condition block, we can use the formated dates in order to compare them, for example:
![Ionut_Dumitrascu_5-1624448427569.png Ionut_Dumitrascu_5-1624448427569.png](https://community.qlik.com/t5/image/serverpage/image-id/57407i06BB52B0804E3351/image-size/medium?v=v2&px=400)
The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.