Put a TOML settings file in, and take the same settings out as JSON for a program that only reads JSON.
FluffyShieldProtected workspace
Loading the tool…
The tool didn't load. Reload the page, or check whether an extension or network filter blocks .
Free · No upload · No sign-up · No usage quotas
What happens to a TOML date in JSON?
In TOML a date written without quotes is a date, not text. JSON has no dates, so the converter writes it as text in ISO form.
FluffyBench · 3 min read · Reviewed
From TOML to JSON
Read the TOML and check every date is a real one
→Write each date and time as text in ISO form
→Write the settings out as JSON
What it does
1.0 comes out as 1
JSON has a single kind of number, so a TOML decimal with nothing after the point loses its .0.
Tables become objects
[menu] and the lines under it become one object called menu, inside the main one. An object is JSON's braces-wrapped group of names and values.
Impossible dates caught
A date that doesn't exist, such as the 30th of February, stops it with "This TOML calendar date does not exist."
Limits Whole numbers past 9,223,372,036,854,775,807 stop it, because TOML itself has no integer that large.
A website's settings with the day the shop opened
Many small websites are built from a settings file, and the bakery's is written in TOML: lines of name = value, grouped under headings in square brackets that TOML calls tables. One of the settings is the day the shop opened, which the site prints in its footer.
You need the same settings as JSON for another tool, so you paste the file in. The opening day comes out as text in quotes, and the status line says: "Dates and times were written as text, in the form TOML gives them."
A date in TOML is more than text that looks like one
Written without quotes, the opening day in that file isn't a few characters that happen to look like a date. It is a date: TOML has kinds of value for a date, a time of day, or both. A program reading the file gets a real date it can count days from.
JSON has text, numbers, true, false, null, lists and objects, and nothing for dates. So the converter writes the date as text, in ISO form, and leaves the program on the other end to read it.
Putting the date in quotes in the TOML gives the same JSON:
Date or text
Quoted or not, the JSON gets the same ten characters. How we checked
Times work the same way. opens = 07:30:00 under a [hours] table comes out as "07:30:00.000". A time finer than a millisecond stops the run instead, because writing it would lose digits.
Converting the file
Paste the settings file into the TOML box.
Tap or click anywhere outside the box. The status line says dates and times were written as text.
Look at the date of the setting named opened in the JSON. It is text in quotes.
On a phone, switch to the Result tab to see the JSON.
Press Copy to put the JSON on your clipboard.
Ours has the date on line 3. If the program reading the JSON wants a number or a different date layout, change it there; the converter writes ISO form, and a time gets milliseconds.