Default Deal Create Date

GregP
Contributor

When a deal is created, the Create Date seems to be set to 12:00am UTC of that day. However, because a time of day was set, the date then displays adjusted for your timezone, so in the US, that ends up displaying as the proir day (so off by a day on in the date) at whatever negative shift of hours the timezone is from UTC.


It seems like it would be way better to store the actual time information including time of day, so that the date would display properly regardless of time zone. The actual time is already being stored in the property history, so why not just populate that in the value?

 

Why is this how it is currently set up? I don't really see a benifit, as your not just throwing out data, but overwritting it with incorrect data, and it results in the incorrect date being displayed.

0 Upvotes
2 Accepted solutions
noahmckeon
Solution
Top Contributor | Elite Partner
Top Contributor | Elite Partner

Hi @GregP ! The only time I've seen the date be set in that way is if the deal is being created via the API, in which case if you don't provide a timestamp and then also offset that by the correct number of hours based on your local timezone, it tends to display it the way you've described.

However, if you create a deal from within the UI, it does capture the time automatically, like so:

Screen Shot 2021-11-02 at 2.50.42 PM.png

Can you confirm how you're creating these deals today?


Best,
Jay Hendricks

SyncMatters | Noah McKeon

View solution in original post

GregP
Solution
Contributor

Here's some more info on this.

There are two backend types: date and dateTime

Both of these backend types use the same frontend fieldType: date

 

https://developers.hubspot.com/docs/api/crm/properties

 

Of note: within the GUI you can only create custom date type properties, and not custom dateTime type properties. You can however create custom dateTime type properties via API.

If the property is a date type property, then the displayed date assumes GMT as the timezone, and entirely ingnores your timezone settings. This can result in the date displaying as off by a day if the timecode falls in the difference between your timezone and GMT.

If the property is a dateTime type property, then the displayed date will use your timezone settings, and will generally act as one would expect.

For custom properties, if you can, I would highly suggest creating all of your date properties as dateTime type via API, if you have any integrations, or even the slightest chance of using integrations down the line. Unfortunately dateTime type properties cannot be created via the normal GUI at this time.

Create Date is a dateTime type, so I think the issue I was having with that was from inconsitencies in the documentation with timestamp formats; but with default HubSpot properties you never know — they have inconsistent code all over the place.

View solution in original post

5 Replies 5
GregP
Solution
Contributor

Here's some more info on this.

There are two backend types: date and dateTime

Both of these backend types use the same frontend fieldType: date

 

https://developers.hubspot.com/docs/api/crm/properties

 

Of note: within the GUI you can only create custom date type properties, and not custom dateTime type properties. You can however create custom dateTime type properties via API.

If the property is a date type property, then the displayed date assumes GMT as the timezone, and entirely ingnores your timezone settings. This can result in the date displaying as off by a day if the timecode falls in the difference between your timezone and GMT.

If the property is a dateTime type property, then the displayed date will use your timezone settings, and will generally act as one would expect.

For custom properties, if you can, I would highly suggest creating all of your date properties as dateTime type via API, if you have any integrations, or even the slightest chance of using integrations down the line. Unfortunately dateTime type properties cannot be created via the normal GUI at this time.

Create Date is a dateTime type, so I think the issue I was having with that was from inconsitencies in the documentation with timestamp formats; but with default HubSpot properties you never know — they have inconsistent code all over the place.

GregP
Contributor

Hmm, can't figure out how to delete this reply.

0 Upvotes
GregP
Contributor

Ah, okay, thanks for that clarification. That does look to be the issue, as we have some deals created manually and some via API. The manual ones are displaying fine. We just happened to only look at deals that had been created by the API. I'll be sure to get the API created ones set up properly for moving forward.

It's still interesting that the timestamp on the property history stores the time properly, so it seems like HubSpot could have the ability to set this with the adjusted time without having to manually post it.

0 Upvotes
noahmckeon
Top Contributor | Elite Partner
Top Contributor | Elite Partner

Yeah, you're not wrong! We haven't really seen this with the APIs of other CRMs before, so it's definitely an adjustment.

SyncMatters | Noah McKeon
0 Upvotes
noahmckeon
Solution
Top Contributor | Elite Partner
Top Contributor | Elite Partner

Hi @GregP ! The only time I've seen the date be set in that way is if the deal is being created via the API, in which case if you don't provide a timestamp and then also offset that by the correct number of hours based on your local timezone, it tends to display it the way you've described.

However, if you create a deal from within the UI, it does capture the time automatically, like so:

Screen Shot 2021-11-02 at 2.50.42 PM.png

Can you confirm how you're creating these deals today?


Best,
Jay Hendricks

SyncMatters | Noah McKeon