ISO 8601 Date Time Script: Date Format Strings

These strings are intended to be used for the date format function for use with my ISODateTime script. This is still under development and may change before the script is completed. Comments are welcome.

String Description
Year +YYYYY (5 or more) 4 or more digit year, padded with zeros (0) as required to make the number of digits equal to the number of characters in the string, including the leading plus sign (+) for year's greater than or equal to 0000, or leading minus sign (-) for years less than 0000.
YYYYY (5 or more) 4 or more digit year, padded with zeros (0) as required to make the number of digits equal to the number of characters in the string. The leading minus sign (-) will precede years less than 0000.
+YYYY 4 or more digit year, as required, including the leading plus sign (+) for year's greater than or equal to 0000, or leading minus sign (-) for years less than 0000.
YYYY 4 or more digit year, as required. The leading minus sign (-) will precede years less than 0000.
YY 2 digit year, excluding the century.
Month MMMM Full month name. eg. “January”, “February”, …, “December”.
MMM 3 letter month name abbreviation. eg. “Jan”, “Feb”, …, “Dec”.
MM 2 digit month number with leading zero (0), from January (01) to December (12).
M 1 or 2 digit month number without leading zero (0) from January (1) to December (12).
Week ww 2 digit week number with leading zero (0), from 01 to 53.
w 1 or 2 digit week number without leading zero (0), from 1 to 53.
Day DDD 3 digit day of year, from 001 to 365 or 366 in leap years.
DD 2 digit day of month, from 01 to 31.
D 1 or 2 digit day of month, from 1 to 31.
dddd Full day of week name. eg. “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”, “Sunday”.
ddd 3 letter day of week name abbreviation. eg. “Mon”, “Tue”, “Wed”, “Thu”, “Fri”, “Sat”, “Sun”.
dd 1 letter day of week name initial. eg. “M”, “T”, “W”, “T”, “F”, “S”, “S”.
d 1 digit day of week, from Monday (1) to Sunday (7).
Hour HH 2 digit hour of day with leading zero (0) using 24 hour clock, from 00 to 24.
H 1 or 2 digit hour of day without leading zero (0) using 24 hour clock, from 0 to 24.
hh 2 digit hour of day with leading zero (0) using 12 hour clock, from 01 to 12, where 12am equals 12 midnight, which equals 00:00 and 24:00 in 24 hour time; and 12pm equals 12 midday, which equals 12:00 in 24 hour time. The use of 12 hour time is not recommended because no distinction can be made between the time representing 00:00 (beginning of day) or 24:00 (end of day), so care must be taken when using this.
h 1 or 2 digit hour of day without leading zero (0) using 12 hour clock, from 1 to 12. Rules about am and pm are applied the same as hh.
Minute mm 2 digit minute of hour with leading zero (0), from 00 to 59.
m 1 or 2 digit minute hour of day without leading zero (0), from 0 to 59.
Second ss 2 digit second of minute with leading zero (0), from 00 to 59, or 60 for leap seconds.
s 1 or 2 digit second of minute without leading zero (0), from 0 to 59, or 60 for leap seconds.
Timezone Offset +Zhh:mm Timezone offset hour and minute with seperator (:) including leading plus sign (+), or “Z” for UTC.
Zhh:mm Timezone offset hour and minute with seperator (:) excluding leading plus sign (+), but including leading minus sign (-) if required, or “Z” for UTC.
+Zhhmm Timezone offset hour and minute without seperator (:) including leading plus sign (+) or minus sign (-), or “Z” for UTC.
Zhhmm Timezone offset hour and minute without seperator (:) excluding leading plus sign (+), but including leading minus sign (-) if required, or “Z” for UTC.
+Zhh Timezone offset hour with leading zero (0) including leading plus sign (+) or minus sign (-). +00 will be returned for UTC.
Zhh Timezone offset hour without leading zero (0) excluding leading plus sign (+), but including leading minus sign (-) if required. 00 will be returned for UTC.
+Zh Timezone offset hour without leading zero (0) including leading plus sign (+) or minus sign (-). +0 will be returned for UTC.
Zh Timezone offset hour with leading zero (0) excluding leading plus sign (+), but including leading minus sign (-) if required. 0 will be returned for UTC.
Zmm Timezone offset minute with leading zero (0).
Zm Timezone offset minute without leading zero (0).