formatSafe
Safely format a date in local timezone with with typed tokens.
formatSafe()
Notes
formatSafe()is just a wrapper around theformat()method that provides type-safe formatting with IntelliSense support.- Format tokens are same as format method.
Signature
formatSafe(format?: SafeFormat, useUTC?: boolean): stringParameters
format: PredefinedSafeFormatformatuseUTC: Use UTC time (default:false)
Return Type
string - Formatted date
Notes
- Provides type-safe formatting with IntelliSense support
- See
SafeFormattype for available formats
Example
playground.ts
Last updated: Thu, May 21, 2026 04:59:08PM (UTC)
