Squiggly

Dates

now, dateFormat, dateParse — built on java.time.

Date/time builtins use Java’s java.time API. Available on JVM and Scala Native (which has a java.time shim) — Scala.js works too via scala-java-time if you pull it in as a dep.

FunctionArityWhat
now0Current LocalDateTime
dateFormat2dateFormat date pattern — render a date with a DateTimeFormatter pattern
dateParse2dateParse string pattern — parse a string into a date

Examples

{{ now | dateFormat 'yyyy-MM-dd' }}                today
{{ .page.date | dateFormat 'MMMM d, yyyy' }}        December 7, 2025
{{ .page.date | dateFormat 'EEEE' }}                day of week

{{ d := dateParse .feed.pubDate 'EEE, dd MMM yyyy HH:mm:ss Z' }}
{{ d | dateFormat 'yyyy-MM-dd' }}                   re-format

Pattern reference

The patterns are standard java.time.format.DateTimeFormatter patterns — see the JDK reference for the full grammar. Common pieces:

PatternMeaningExample
yyyyFour-digit year2025
MMZero-padded month07
MMMShort month nameJul
MMMMFull month nameJuly
ddZero-padded day02
dDay, no padding2
EEEShort weekdayMon
EEEEFull weekdayMonday
HH24-hour hour14
mmMinutes05
ssSeconds09
ZNumeric zone+0500
zzzShort zone nameEST