- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Compare Dates in HUBL code - Find within the last 7 days
SOLVEMar 31, 2017 10:51 AM
I am trying to use Hubl code to find if a date is within the last 7 days. The date is coming from a HubDB table and appears to be saved as a UTC date in HubDB. I'm doing this in code used to generate an email so using javascript in the solution is out. My issue is the local_dt is not in UTC(can't seem to get UTC) and HubDB date is UTC.
In summary Hubl only code that would work like this:
If HubDBdate > (todaysDate - 7 days) then
(Again note using javascript is not an option, I have a solution working that way but the email builder won't with the javascript)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Accepted Solutions
Mar 31, 2017 1:45 PM
Hi Myriad,
You can convert {{ local_dt }} to a timestamp using the HubL function {{ unixtimestamp( local_dt ) }}
More info here: http://designers.hubspot.com/en/docs/hubl/hubl-supported-functions#hs_cos_wrapper_widget_14858148265...
I hope that helps,
Anthony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content