ChronosChronos

formatSafe

Safely format a date in local timezone with with typed tokens.

formatSafe()

Notes

  • formatSafe() is just a wrapper around the format() method that provides type-safe formatting with IntelliSense support.
  • Format tokens are same as format method.

Signature

formatSafe(format?: SafeFormat, useUTC?: boolean): string

Parameters

  • format: Predefined SafeFormat format
  • useUTC: Use UTC time (default: false)

Return Type

string - Formatted date

Notes

  • Provides type-safe formatting with IntelliSense support
  • See SafeFormat type for available formats

Example

playground.ts

Last updated: Thu, May 21, 2026 04:59:08PM (UTC)

On this page