How to get createdAt time zone form webhook? | Community
Skip to main content
Mykhailo_Starod
Level 2
October 30, 2019
Question

How to get createdAt time zone form webhook?

  • October 30, 2019
  • 2 replies
  • 2259 views

Hi,

My goal is to get the absolute time of lead creation from webhook. I added the next token to webhook template: {{lead.Created At}}. But in the result, I have a string like this: "2019-10-29 16:27:41". This date does not provide time zone information and looks like it uses the account time zone. Questions are:

  • Is it possible to specify the date format in webhook template?
  • Is it possible to get an account time zone from webhook?

P.S. Format "yyyy-MM-dd hh:mm:ss" is not the best practice for the program interface.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

SanfordWhiteman
Level 10
October 30, 2019
This date does not provide time zone information and looks like it uses the account time zone.

Yes.

Is it possible to specify the date format in webhook template?

No.

Is it possible to get an account time zone from webhook?

No, unless you manually pass it as a field.

P.S. Format "yyyy-MM-dd hh:mm:ss" is not the best practice for the program interface.

It's valid ISO 8601 local. I don't know what you mean by "best practice" unless you're referring to the absence of an explicit timezone for transport outside the system.

Mykhailo_Starod
Level 2
October 30, 2019

No, unless you manually pass it as a field.

Duplicate system time zone in the webhook template is not a good solution. Does it possible to request a new system token: {{system.timezone}}?

An alternative solution is to provide a possibility to set date format in the token: {{createdAt:format=yyyy-MM-dd'T'hh:mm:ssZ}}

It's valid ISO 8601 local. I don't know what you mean by "best practice" unless you're referring to the absence of an explicit timezone for transport outside the system.

Yes. Local date is fine for user interface but not for the system to system communication

SanfordWhiteman
Level 10
October 30, 2019

Well, it's what you've got.

In years of building webhook-compatible services for Marketo, this particular behavior has never stopped a project from being implemented, as every admin knows their tz and it's rarely, if ever, changed.

It could be better, yes. You can open some Ideas (which may already exist).