SOQL Date/DateTime Literal Formatter
Convert a date or datetime into exact SOQL literal syntax — DST-aware, ready to paste into a query.
Timezone
SOQL Date Literal
Use for Date fields (e.g. CloseDate, Birthdate)
SOQL DateTime Literal
Use for DateTime fields (e.g. CreatedDate, LastModifiedDate)
SOQL relative date literal reference
These are used directly in SOQL, unquoted — there's nothing to convert. This is a reference, not a converter.
Day
TODAY,YESTERDAY,TOMORROWLAST_N_DAYS:n/NEXT_N_DAYS:nN_DAYS_AGO:nLAST_90_DAYS/NEXT_90_DAYS
Week
LAST_WEEK,THIS_WEEK,NEXT_WEEKLAST_N_WEEKS:n/NEXT_N_WEEKS:n
Month
LAST_MONTH,THIS_MONTH,NEXT_MONTHLAST_N_MONTHS:n/NEXT_N_MONTHS:n
Quarter
LAST_QUARTER,THIS_QUARTER,NEXT_QUARTERLAST_N_QUARTERS:n/NEXT_N_QUARTERS:n
Year
LAST_YEAR,THIS_YEAR,NEXT_YEARLAST_N_YEARS:n/NEXT_N_YEARS:n
Fiscal
THIS_FISCAL_QUARTER,LAST_FISCAL_QUARTER,NEXT_FISCAL_QUARTERTHIS_FISCAL_YEAR,LAST_FISCAL_YEAR,NEXT_FISCAL_YEAR
Requires your org's fiscal year config — this tool doesn't attempt to resolve fiscal boundaries.