Library / Building Blocks & Utilities
Building Blocks & Utilities
Work with Dates and Times in n8n
When you run it, it demonstrates calculating, setting and formatting dates and times, such as adding 12 hours.
What it does
### 2.1 Working with an existing time string As items pass between nodes, n8n saves dates as ISO strings. This means that in order to work with the data as a date again, we need to convert it back using DateTime.fromISO('yyyy-mm-dd') . Once doing that, we are able to apply date and time function again such as : {{DateTime.fromISO($json["Now"]).toFormat('yyyy LLL dd')}}
The steps
- On clicking 'execute'
- 12 Hours from now
- Set times
- Edit times
- Format - MMMM DD YY
Similar automations
Calendar & SchedulingConvert University Term Dates into a Calendar ICS File12 stepsDocuments, PDF & OCREmail University Term Dates from Excel with Gemini33 stepsCode, Git & Developer ToolsActivate and Deactivate n8n Workflows at Set Times8 stepsData Sync & ETLCreate Geotab Zones for New Salesforce Work Orders14 steps