> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/snippets/format-dates.md).

# 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](/code/cookbook/luxon.md).
## 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 }).

## Related

- [Work with dates using Luxon in Duaer](https://doc.duaer.com/code/cookbook/luxon.md)
- [Date transformation methods in Duaer](https://doc.duaer.com/code/builtin/data-transformation-functions/dates.md)
- [Group, sum, and count items in Duaer (like a pivot table)](https://doc.duaer.com/snippets/group-and-sum.md)

