tantek.com

t

  1. talking HTML templates in #indiewebcamp, @KevinMarks asked for datetime, so I made a formatting format (yo dawg...)

    tl;dr: YYYY YY MM M DDD DD D MONTH MNTH DAY DY 24HH 24H HH H MM SS TH AM PM TZ TZH TZO

    Not obvious what those expand to?

    For an example date and time of:
    2001-02-03 4:05:06pm PST

    YYYY = 2001
    YY = 01
    MM = 02
    M = 2
    DDD = 034
    DD = 03
    D = 3
    MONTH = February
    MNTH = Feb
    DAY = Saturday
    DY = Sat
    24HH = 16
    24H = 16 (no leading zero, e.g. at midnight = 0)
    HH = 04
    H = 4
    MM = 05
    SS = 06
    TH = ordinal suffix for preceding number, e.g. with M, D, H:
     MTH = 2nd
     DTH = 3rd
     HTH = 4th
    AM|PM = pm (both AM & PM - use either without guessing)
    TZ = PST
    TZH = -08:00
    TZO = -0800

    Thus the above example date and time of
    2001-02-03 4:05:06pm PST
    would have been output formatted with:
    YYYY-MM-DD H:MM:SSAM TZ

    Did I miss anything that's published on real world indieweb sites?

    Obligatory XKCDs

    xkcd.com/927 a png. Previously:
    tantek.com/2011/238/b1/many-ways-slice-url-name-pieces

    xkcd.com/1179 a png. Previously:
    tantek.com/2013/227/t1/xkcd-use-iso-8601-dates

    Now to implement it in @cassisjs.

    on