Public
Edited
Jul 24, 2023
Insert cell
Insert cell
new Date().toISOString()
Insert cell
dateFns.formatISO(new Date())
Insert cell
dateFns.differenceInHours(new Date(2020, 1, 1), new Date(2020, 1, 0))
Insert cell
dateFns.parse("2023-07-18-21-31-11", "yyyy-MM-dd-HH-mm-ss", new Date())
Insert cell
dateFns.formatISO(
dateFns.parse("2023-07-18-21-31-11-Z", "yyyy-MM-dd-HH-mm-ss-X", new Date())
)
Insert cell
dateFns
.parse("2023-07-18-21-31-11-Z", "yyyy-MM-dd-HH-mm-ss-X", new Date())
.toISOString()
Insert cell
function dateToISOString(date) {
return date.toISOString().split("T")[0]
}
Insert cell
function dateTimeToISOString(date) {
return date.toISOString().split(".")[0] + "Z";
}
Insert cell
dateToISOString(new Date())
Insert cell
dateTimeToISOString(new Date())
Insert cell
dateFns.parseISO("2023-07-24T10:50:52Z")
Insert cell
dateTimeToISOString(dateFns.parseISO("2023-07-24T10:50:52Z"))
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more