Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

Functions

  • Parses a string based on a specified format and returns a DateTime

    description

    List of all available parsing tokens:

    Token Example Description
    YY 01 Two-digit year
    YYYY 2001 Four-digit year
    M 1-12 Month, beginning at 1
    MM 01-12 Month, 2-digits
    d 1-31 Day of month
    dd 01-31 Day of month, 2-digits
    H 0-23 Hours
    HH 00-23 Hours, 2-digits
    h 1-12 Hours, 12-hour clock
    hh 01-12 Hours, 12-hour clock, 2-digits
    m 0-59 Minutes
    mm 00-59 Minutes, 2-digits
    s 0-59 Seconds
    ss 00-59 Seconds, 2-digits
    S 0-9 Hundreds of milliseconds, 1-digit
    SS 00-99 Tens of milliseconds, 2-digits
    SSS 000-999 Milliseconds, 3-digits
    Z -05:00 Offset from UTC
    ZZ -0500 Compact offset from UTC, 2-digits
    A AM PM Post or ante meridiem, upper-case
    a am pm Post or ante meridiem, lower-case

    Parameters

    • date: string

      date string to parse

    • format: string

      date format

    • Optional opts: DateTimeCreationOptions

      DateTimeCreationOptions

    Returns DateTime

    A DateTime object

Generated using TypeDoc