CommunityHire an ExpertSign Up
DatabasesDate and time formatting
Tables and fields

Date and time formatting in Softr Databases

Choose how date fields display in Softr Databases, and use pattern letters such as yyyy-MM-dd in formulas to turn a date into text, with every letter listed.

Dates show up in two places in a database: in Date fields, where you pick a display style, and in formulas, where you write a pattern such as yyyy-MM-dd. Use the display settings to match the habits of your users. Use patterns when you need an exact text, such as a label, a file name or a value for another tool.

Format a date field

A Date field stores one moment in UTC. Its settings only change how Softr shows that moment.

Open the field settings. They hold these options:

The settings of a Due date field: Show time, Display time zone with a Change default link, Date format set to Based on user locale with a Change link, Use relative time, a preview of the date, and Default date

SettingWhat it does
Show timeShows the time next to the date.
Convert to user time zoneShows the time in each user’s time zone. Available when Show time is on.
Display time zoneShows the time in one time zone for everyone. Appears when Show time is off, or when Convert to user time zone is off. The default is the default time zone of the database: select Change default to change it.
Date format or Date & time formatShows the current format. Select Change to open the localization settings.
Use relative timeShows values less than a week old as “2 days ago”. Older values show the full date.
Default dateFills the field when a record is created: None, or Created date (or Created date & time when Show time is on).

Choose the date style

The date style belongs to the database, not to one field. To change it, select Change in the field settings. You can also open the database menu and choose Localization.

Under Date & time format, choose one of three options:

  • Based on user locale: each user sees the format their browser prefers. This is the default.
  • Custom: you choose every part of the format.
  • A language and region, such as English (United States): you choose a Style of Short, Medium or Long.

With Custom, you set these options:

SettingChoices
Date formatFriendly (Jul 10, 2004), MM DD YYYY, DD MM YYYY, YYYY MM DD
Separator-, / or .. Appears for every date format except Friendly.
Time format12 hours (02:30 PM) or 24 hours (14:30)
Start week onMonday, Saturday or Sunday

The settings show a preview of the result. For number and currency formats, see Field types.

Format a date in a formula

The DATETIME_FORMAT function turns a date into text with a pattern. The pattern is a list of letters, and each letter stands for one part of the date.

DATETIME_FORMAT({Due Date}, "MMM d, yyyy")

The result is text, so it no longer works as a date. Keep the date field for sorting and filtering, and use the text for display.

DATETIME_PARSE uses the same patterns in the other direction. It reads a text such as 12/31/2025 with the pattern MM/dd/yyyy and returns a date. For both functions, see Formula reference.

Common patterns

For the date July 10, 2004, 14:30:

PatternResult
yyyy-MM-dd2004-07-10
MM/dd/yyyy07/10/2004
MMM d, yyyyJul 10, 2004
MMMM d, yyyyJuly 10, 2004
EEEESaturday
HH:mm14:30
h:mm a2:30 PM
yyyy-MM-dd'T'HH:mm:ss2004-07-10T14:30:00

A date without a time counts as midnight. HH:mm on such a date returns 00:00.

Pattern letters

Softr formulas use the Java date pattern syntax (DateTimeFormatter in Java 21).

LetterMeaningExample
GEraAD
yYear of era2004; 04
uYear2004; 04
YWeek-based year2004
M or LMonth7; 07; Jul; July
Q or qQuarter3; 03; Q3; 3rd quarter
wWeek of the week-based yearDepends on the locale
WWeek of the monthDepends on the locale
DDay of the year192
dDay of the month10
EDay of the week, as textSat; Saturday
e or cDay of the week, as number or textDepends on the locale
aAM or PMPM
HHour of the day, 0 to 2314
hHour of AM or PM, 1 to 122
KHour of AM or PM, 0 to 112
kHour of the day, 1 to 2414
mMinute30
sSecond55
SFraction of a second978
AMillisecond of the day52200000
nNanosecond of the second987654321
NNanosecond of the day52200000000000

Time zone letters (V, z, O, X, x, Z) do not work. Softr formulas hold dates without a time zone, so a pattern with one of these letters leaves the cell empty. To show another time zone, use SET_TIMEZONE first.

How letter counts work

The number of times you repeat a letter changes the result.

KindRuleExample
Text1 to 3 letters give the short form, 4 give the full form, 5 give the first letter.MMM gives Jul, MMMM gives July, MMMMM gives J
NumberOne letter gives the number as it is. More letters pad the number with zeros to that width.d gives 5, dd gives 05
Number or text3 or more letters give text. Fewer give a number.M gives 7, MM gives 07
YearTwo letters give the last two digits. Four letters give the full year.yy gives 04, yyyy gives 2004
FractionEach letter adds one digit of the fraction of a second, from 1 to 9.SSS gives 978

These limits apply: d, H, h, K, k, m and s take up to two letters, and D takes up to three.

Text and special characters

  • Put literal text between single quotation marks: yyyy-MM-dd'T'HH:mm. Quote every letter you want to keep as it is.
  • Write two single quotation marks to output one: ''.
  • Characters that are not letters, such as -, /, :, , and a space, appear as they are.
  • Square brackets [ and ] mark an optional part, used when reading text with DATETIME_PARSE.
  • The characters #, { and } are reserved. Do not use them.
  • An unknown letter, or a letter repeated too many times, leaves the cell empty.

Use these docs with your AI tools

An AI agent can read this documentation directly. You do not need an account or an API key. Everything here is public and read-only.

Query these docs via MCP

Recommended

Add this server to Claude, Claude Code, Cursor, Mistral, or any tool that supports MCP. Your agent can then search Softr Documentation documentation and read it in full, instead of answering from memory.

https://docs.softr.io/mcp
  • searchFind the passages that answer a question.
  • fetchRead one page in full, as Markdown.
  • list_pagesSee every page in this documentation.

Query these docs over HTTP

The same tools also work as plain web requests. Use this for scripts, or for any tool that does not support MCP. There is one endpoint per tool. Arguments go in the query string, and the answer comes back as JSON.

https://docs.softr.io/api/docs/search?query=custom+domain

Read the OpenAPI description. It is built from the same definitions as the tools, so it always matches what the endpoints do.

Read these docs as Markdown

Add .md to any page URL to get its Markdown source. You can also send the headerAccept: text/markdown to the page URL itself.

To read the whole documentation in one file, open llms-full.txt. For a short index of every page, open llms.txt.