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

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more