Options
All
  • Public
  • Public/Protected
  • All
Menu
     

Class StrTime

Modifier Description
A Full weekday name.
a Abbreviated weekday name.
B Full month name.
b Abbreviated month name.
C AD century (year/100), padded to 2-digits.
c Equivalent to %a %b %d %X %Y %Z in en_US (based on locale).
D Equivalent to %m/%d/%y in en_US (based on locale).
d Day of the month, padded to 2-digits (01-31).
e Day of the month, padded with a leading space for single digit values (1-31).
F Equivalent to %Y-%m-%d in en_US (based on locale).
H The hour (24-hour clock), padded to 2-digits (00-23).
h The same as %b (abbreviated month name).
I The hour (12-hour clock), padded to 2-digits (01-12).
j Day of the year, padded to 3-digits (001-366).
k The hour (24-hour clock), padded with a leading space for single digit values (0-23).
L The milliseconds, padded to 3-digits (Ruby extension)`.
l The hour (12-hour clock), padded with a leading space for single digit values (1-12).
M The minute, padded to 2-digits (00-59).
m The month, padded to 2-digits (01-12).
n Newline character.
o Day of the month as an ordinal (without padding), e.g. 1st, 2nd, 3rd, 4th, ....
P am or pm in lowercase (Ruby extension, based on locale).
p AM or PM (based on locale).
R Equivalent to %H:%M in en_US (based on locale).
r Equivalent to %I:%M:%S %p in en_US (based on locale).
S The second, padded to 2-digits (00-60).
s The number of seconds since the Epoch, UTC.
T Equivalent to %H:%M:%S in en_US (based on locale).
t Tab character.
U Week number of the year, Sunday as the first day of the week, padded to 2-digits (00-53).
u The weekday, Monday as the first day of the week (1-7).
v Equivalent to %e-%b-%Y in en_US (based on locale).
W Week number of the year, Monday as the first day of the week, padded to 2-digits (00-53).
w The weekday, Sunday as the first day of the week (0-6).
X Equivalent to %D in en_US (based on locale).
x Equivalent to %T in en_US (based on locale).
Y The year with the century.
y The year without the century (00-99).
Z The time zone name, replaced with an empty string if it is not found.
z The time zone offset from UTC, with a leading plus sign for UTC and zones east of UTC and a minus sign for those west of UTC, hours and minutes follow each padded to 2-digits and with no delimiter between them.

Hierarchy

  • StrTime

Callable

  • StrTime(fmt: string, d: Date, locale: DateLocale): string
  • Modifier Description
    A Full weekday name.
    a Abbreviated weekday name.
    B Full month name.
    b Abbreviated month name.
    C AD century (year/100), padded to 2-digits.
    c Equivalent to %a %b %d %X %Y %Z in en_US (based on locale).
    D Equivalent to %m/%d/%y in en_US (based on locale).
    d Day of the month, padded to 2-digits (01-31).
    e Day of the month, padded with a leading space for single digit values (1-31).
    F Equivalent to %Y-%m-%d in en_US (based on locale).
    H The hour (24-hour clock), padded to 2-digits (00-23).
    h The same as %b (abbreviated month name).
    I The hour (12-hour clock), padded to 2-digits (01-12).
    j Day of the year, padded to 3-digits (001-366).
    k The hour (24-hour clock), padded with a leading space for single digit values (0-23).
    L The milliseconds, padded to 3-digits (Ruby extension)`.
    l The hour (12-hour clock), padded with a leading space for single digit values (1-12).
    M The minute, padded to 2-digits (00-59).
    m The month, padded to 2-digits (01-12).
    n Newline character.
    o Day of the month as an ordinal (without padding), e.g. 1st, 2nd, 3rd, 4th, ....
    P am or pm in lowercase (Ruby extension, based on locale).
    p AM or PM (based on locale).
    R Equivalent to %H:%M in en_US (based on locale).
    r Equivalent to %I:%M:%S %p in en_US (based on locale).
    S The second, padded to 2-digits (00-60).
    s The number of seconds since the Epoch, UTC.
    T Equivalent to %H:%M:%S in en_US (based on locale).
    t Tab character.
    U Week number of the year, Sunday as the first day of the week, padded to 2-digits (00-53).
    u The weekday, Monday as the first day of the week (1-7).
    v Equivalent to %e-%b-%Y in en_US (based on locale).
    W Week number of the year, Monday as the first day of the week, padded to 2-digits (00-53).
    w The weekday, Sunday as the first day of the week (0-6).
    X Equivalent to %D in en_US (based on locale).
    x Equivalent to %T in en_US (based on locale).
    Y The year with the century.
    y The year without the century (00-99).
    Z The time zone name, replaced with an empty string if it is not found.
    z The time zone offset from UTC, with a leading plus sign for UTC and zones east of UTC and a minus sign for those west of UTC, hours and minutes follow each padded to 2-digits and with no delimiter between them.

    Parameters

    Returns string

Index

Methods

Static strftime

  • strftime(fmt: string, d: Date, locale: DateLocale): string
  • Parameters

    Returns string

Static localize

  • Parameters

    Returns function

      • (fmt: string, d: Date): string
      • Parameters

        • fmt: string
        • d: Date

        Returns string

Static timezone

  • timezone(timezone: string | number): function
  • Parameters

    • timezone: string | number

    Returns function

      • (fmt: string, d: Date): string
      • Parameters

        • fmt: string
        • d: Date

        Returns string

Static utc

  • utc(): function
  • Returns function

      • (fmt: string, d: Date): string
      • Parameters

        • fmt: string
        • d: Date

        Returns string