Convert a Date to ISO String Without Time

Formats a Date object to an ISO string without the time portion.

TypeScript
david

14 weeks ago

function toISODate(date: Date): string {
  return date.toISOString().split("T")[0];
}
0
4
0