I’m using a Webhook workflow to support creating rows using a variety of external methods. It’s working great, but my app has important functions that use the creation date of a row, and the Current Date/Time generated by the workflow appears to be in UTC. Is there a way to correct for this? Per this thread I already know my user time zone offset, but I don’t see how I can access that in the workflow. The best I can do is bake in my current -7 offset using a Math node: Now - (7 / 24)
.
Maybe the right answer here is to make the UTC offset part of the data expected by the webhook?
But since the web hook workflow supports “Current Date/Time” it seems like some kind of time-zone awareness is warranted.
You have to test again just to be sure, but I think webhook’s current date/time is just UTC, not “your” current date/time.
If it’s the case, it would be nice if it can reference the timezone that we set in daily scheduled runs, for example.
To correct it, perhaps you can try sending the current date/time from whatever triggered the webhook and see if that value is correct?
If it isn’t, I think the most straightforward way is to pass your timezone offset as a number to the webhook (use manual trigger so you don’t have to do a bunch of JSON queries), then use a math step to calculate “your” current date/time based on the webhook’s “now” value.
Yeah my workaround of expecting the webhook data to include the user’s time zone offset from UTC is working for now.
You should use a manual workflow to not have to use that many query JSONs, I think.
Interesting, do you have an example of this? I couldn’t get my webhook automations to work without the Query steps.
Here’s the one to use.
In there, you can define variables that you accept as input. Like in your case, variables can be NoteContent, StartDate etc. Define their types as well.
Configure your Math node and subsequent steps to use those variables from the “Trigger” menu of variables.
Then, from where you’re triggering the webhook, if you’re using a Trigger Webhook node in another action, those variables will show themselves for you to tie data to. If you use an external method, I think you just need to define them in the API call body.
1 Like