This topic was automatically generated from Slack. You can find the original thread here.
Mandar Badve : Hi, I am new to this platform. In one of the workflow I am posting a new tweet. In tweet text I want to add current time. Is there any built in path/keyword to add time? I have used {{event.time}} but this is giving time in UTC I guess. I need time in current with specific time zone or WRT to my account time zone.
I just published an action called Get Current Time in Timezone. This lets you pass a timezone string as a param, and returns the current time in that localized timezone. Check out this workflow for an example.
Note - since you can run any Node.js code on Pipedream, I just used the moment-timezone library to build this action. You can use similar code anywhere in your workflow - just expand the code section of that action to see how it works.
Dylan Sather (Pipedream) : I also published a similar action - Get Time in Timezone - which accepts both a timezone and an ISO 8601 timestamp, so this lets you convert any timestamp (for example, event.time) to the target timezone. See example here.
Hi @dylburger
I need to get the current time for a specific timezone in a workflow, where I add a single line to a google sheet. One column must be the timestamp with current time for timezone.
Your workflow “Get current time in timezone” as posted above does return the data, but I fail to use it in my workflow. Could you help me?
I copied your workflow and it runs fine. But how do I add it to my own workflow?
Do I need to call the “get current time” workflow from within my own workflow? If yes, how do I get the returned value to be used in downstream steps?
Or do I need to create an “action” from it? I haven’t done this before.
Or can I just add your coding to a code-step in my workflow? I failed when trying this.
If you could briefly explain what would be the way to do it, you would greatly help me.
Thank you,
Johannes
Hi @pierce thank you so much for this code snippet with date-fns.
It solved my problem and was very easy to use and very versatile in output date formatting!
Kind regards,
Johannes