Function formatDate

PHP's strftime-like date formatter. IMPORTANT: Use Intl.DateTimeFormat everywhere possible. Use this only if you are 100% sure you want to have given date format, not depending on any locale standards.

Important: this is work in progress. All locale-based values are not supported yet. Formats that heavily depend on locale won't ever be supported.

  • Parameters

    • date: number | Date
    • format: string
    • locale: string = "en-US"

    Returns string