Jan 17, 20214:06 AM - edited Jan 17, 20214:32 PM
Member
How to convert date string (dd/MM/yy) to date object in HubL?
SOLVE
Hi,
I am trying to convert the string date which displays as dd/mm/yy to date object. There is a pick date property in hubspot that returns the date in dd/mm/yy. I want to use this to compare to another date object.
here is the code: contact.date_authorized gives out string 1/15/21
{% if request_contact.is_logged_in %}
{% set autdate = contact.date_authorized|strtotime("yyyy-MM-dd'T'HH:mm:ssZ") %}
{% set after2021 = "2020-01-01T14:31:30+0530"|strtotime("yyyy-MM-dd'T'HH:mm:ssZ")|unixtimestamp }} %}
{% if autdate > after2021 %}
print xyz
{% endif %}