Snippets
Common date formats in Duaer expressions
Dates in Duaer expressions are Luxon DateTime values. Copy-ready expressions for today, yesterday, month start and end, timestamps, Excel date numbers, and time zones.
Get the current date in Duaer
- Today: {{ $today.toFormat("yyyy-MM-dd") }}
- Now: {{ $now.toFormat("yyyy-MM-dd HH:mm:ss") }}
- Long form: {{ $now.toFormat("MMMM d, yyyy") }}, such as October 2, 2026
- Yesterday: {{ $today.minus({ days: 1 }).toFormat("yyyy-MM-dd") }}
- First and last day of the month: {{ $today.startOf("month").toISODate() }}, {{ $today.endOf("month").toISODate() }}
- Last Monday: {{ $today.minus({ weeks: 1 }).startOf("week").toISODate() }}
Turn other formats into a Duaer date
- ISO string: {{ DateTime.fromISO($json.createdAt).toFormat("yyyy-MM-dd") }}
- A value like 2026/10/02: {{ DateTime.fromFormat($json.date, "yyyy/MM/dd").toISODate() }}
- Unix seconds: {{ DateTime.fromSeconds(Number($json.ts)).toFormat("yyyy-MM-dd HH:mm") }}; use DateTime.fromMillis for milliseconds.
- An Excel date that shows as a number (such as 45567): {{ DateTime.fromISO("1899-12-30").plus({ days: Number($json.date) }).toISODate() }}
- Days between: {{ Math.floor(DateTime.fromISO($json.due).diff($today, "days").days) }}
Time zones in Duaer
$now and $today follow the digital organization time zone. Set Timezone in workflow settings, or convert in one expression with {{ $now.setZone("America/New_York").toFormat("HH:mm") }}.
The Code node also has DateTime and $now, but date math takes an object, plus({ days: 7 }), and formatting uses toFormat. Refer to Work with dates using Luxon in Duaer.
Questions
Why is $now in Duaer off by several hours?
The Duaer digital organization still uses UTC. Set Timezone in workflow settings, or use setZone() in the expression.
Why does a date from Excel show as a number like 45567 in Duaer?
That is an Excel date serial. In a Duaer expression, convert it with DateTime.fromISO("1899-12-30").plus({ days: number }).
In this section
Work with dates using Luxon in Duaer
Dates in a Duaer expression are Luxon DateTime values. $now and $today already are. The Code node uses native Luxon—format() and plus(amount, unit) do not carry over unchanged.
TransformDate transformation methods in Duaer
In a Duaer expression, $now and $today are Luxon DateTime values. Call toDateTime() on a string or number before format, plus, or setZone.
SnippetsGroup, sum, and count items in Duaer (like a pivot table)
In Duaer, the Summarize node groups items by region, customer, or category and returns sums, counts, and averages without code.