/* This file contains date formats that Frink will parse. See documentation for Java's SimpleDateParser class or https://frinklang.org/#DefiningNewDateTimeFormats for more information. Now that regular expressions are possible in Frink, I'd like to replace this whole mess with a regexp-based solution, which would be more flexible and more powerful. Alan Eliasen Symbol Meaning Presentation Example G era designator Text AD y year Number 1996 (Please don't use 2-digit years. It's just wrong.) M month in year Text & Number July & 07 (3 or more: use text, otherwise use number.) d day in month Number 10 h hour in am/pm Number 12 (1-12) H hour in day Number 0 (0-23) m minute in hour Number 30 s second in min. Number 55 S millisecond Number 978 (WARNING. See below.) WARNING: Due to bugs/features in Java's SimpleDateParser class, you should only use a single S in patterns, (which will match up to 3 digits) because if you have an ".SSS" specifier but just pass, say, ".3" for the milliseconds, Java will parse that as ".003" for some insane reason! If you use this, only use a single S as shown in the patterns below. E day in week Text Tuesday D day in year Number 189 F day of week Number 2 (2nd Wed in July) in month w week in year Number 27 W week in month Number 2 a am/pm marker Text PM k hour in day Number 24 (1-24) K hour in am/pm Number 0 (0-11) ' escape for text Delimiter '' single quote Literal ' Most significant digits are first, as it should be. These are the preferred formats. This also matches ISO-8601 date conventions, so if you're trying to be international, always use yyyy-MM-dd. */ ### yyyy-MM-dd HH:mm:ss.S ### // Full 24-hour format with milliseconds ### yyyy/MM/dd HH:mm:ss.S ### // Full 24-hour format with milliseconds ### yyyy-MM-dd h:mm:ss.S a ### // 12-hour format with milliseconds ### yyyy/MM/dd h:mm:ss.S a ### // 12-hour format with milliseconds ### yyyy-MM-dd a h:mm:ss.S ### // 12-hour format with milliseconds ### yyyy/MM/dd a h:mm:ss.S ### // 12-hour format with milliseconds ### yyyy-MM-dd HH:mm:ss ### // Full 24-hour format ### yyyy/MM/dd HH:mm:ss ### // Full 24-hour format ### yyyy-MM-dd h:mm:ss a ### // Full 12-hour format ### yyyy/MM/dd h:mm:ss a ### // Full 12-hour format ### yyyy-MM-dd a h:mm:ss ### // Full 12-hour format ### yyyy/MM/dd a h:mm:ss ### // Full 12-hour format ### yyyy-MM-dd HH:mm ### // 24-hour format, no seconds ### yyyy/MM/dd HH:mm ### // 24-hour format, no seconds ### yyyy-MM-dd h:mm a ### // 12-hour format, no seconds ### yyyy/MM/dd h:mm a ### // 12-hour format, no seconds ### yyyy-MM-dd a h:mm ### // 12-hour format, no seconds ### yyyy/MM/dd a h:mm ### // 12-hour format, no seconds ### yyyy-MM-dd HH ### // 24-hour format, hour only ### yyyy/MM/dd HH ### // 24-hour format, hour only ### yyyy-MM-dd h a ### // 12-hour format, hour only ### yyyy/MM/dd h a ### // 12-hour format, hour only ### yyyy-MM-dd a h ### // 12-hour format, hour only ### yyyy/MM/dd a h ### // 12-hour format, hour only ### yyyy-MM-dd ### // Date only ### yyyy/MM/dd ### // Date only // All the same as above with AD or BC preceding: ### G yyyy-MM-dd HH:mm:ss.S ### // Full 24-hour format with milliseconds ### G yyyy/MM/dd HH:mm:ss.S ### // Full 24-hour format with milliseconds ### G yyyy-MM-dd h:mm:ss.S a ### // 12-hour format with milliseconds ### G yyyy/MM/dd h:mm:ss.S a ### // 12-hour format with milliseconds ### G yyyy-MM-dd a h:mm:ss.S ### // 12-hour format with milliseconds ### G yyyy/MM/dd a h:mm:ss.S ### // 12-hour format with milliseconds ### G yyyy-MM-dd HH:mm:ss ### // Full 24-hour format ### G yyyy/MM/dd HH:mm:ss ### // Full 24-hour format ### G yyyy-MM-dd h:mm:ss a ### // Full 12-hour format ### G yyyy/MM/dd h:mm:ss a ### // Full 12-hour format ### G yyyy-MM-dd a h:mm:ss ### // Full 12-hour format ### G yyyy/MM/dd a h:mm:ss ### // Full 12-hour format ### G yyyy-MM-dd HH:mm ### // 24-hour format, no seconds ### G yyyy/MM/dd HH:mm ### // 24-hour format, no seconds ### G yyyy-MM-dd h:mm a ### // 12-hour format, no seconds ### G yyyy/MM/dd h:mm a ### // 12-hour format, no seconds ### G yyyy-MM-dd a h:mm ### // 12-hour format, no seconds ### G yyyy/MM/dd a h:mm ### // 12-hour format, no seconds ### G yyyy-MM-dd HH ### // 24-hour format, hour only ### G yyyy/MM/dd HH ### // 24-hour format, hour only ### G yyyy-MM-dd h a ### // 12-hour format, hour only ### G yyyy/MM/dd h a ### // 12-hour format, hour only ### G yyyy-MM-dd a h ### // 12-hour format, hour only ### G yyyy/MM/dd a h ### // 12-hour format, hour only ### G yyyy-MM-dd ### // Date only ### G yyyy/MM/dd ### // Date only // Dates in the form "August 19, 1969" ### MMM d, yyyy ### // Date only ### MMM d, yyyy HH:mm ### // Date and time, 24-hour format ### MMM d, yyyy HH:mm:ss ### // Date and time, 24-hour format ### MMM d, yyyy HH:mm:ss.S ### // Date and time, 24-hour format ### MMM d, yyyy h:mm a ### // 12-hour format, no seconds ### MMM d, yyyy h:mm:ss a ### // 12-hour format with seconds ### MMM d, yyyy h:mm:ss.S a ### // 12-hour format, seconds & millisec ### MMM d, yyyy a h:mm ### // 12-hour format, no seconds ### MMM d, yyyy a h:mm:ss ### // 12-hour format with seconds ### MMM d, yyyy a h:mm:ss.S ### // 12-hour format, seconds & millisec // Same as above but with BC/AD indicator after the year ### MMM d, yyyy G ### // Date only ### MMM d, yyyy G HH:mm ### // Date and time, 24-hour format ### MMM d, yyyy G HH:mm:ss ### // Date and time, 24-hour format ### MMM d, yyyy G HH:mm:ss.S ### // Date and time, 24-hour format ### MMM d, yyyy G h:mm a ### // 12-hour format, no seconds ### MMM d, yyyy G h:mm:ss a ### // 12-hour format with seconds ### MMM d, yyyy G h:mm:ss.S a ### // 12-hour format, seconds & millisec ### MMM d, yyyy G a h:mm ### // 12-hour format, no seconds ### MMM d, yyyy G a h:mm:ss ### // 12-hour format with seconds ### MMM d, yyyy G a h:mm:ss.S ### // 12-hour format, seconds & millisec // Same as above without a space after the comma. Ugh. We need regular // expressions for date parsing. ### MMM d,yyyy ### // Date only ### MMM d,yyyy HH:mm ### // Date and time, 24-hour format ### MMM d,yyyy HH:mm:ss ### // Date and time, 24-hour format ### MMM d,yyyy HH:mm:ss.S ### // Date and time, 24-hour format ### MMM d,yyyy h:mm a ### // 12-hour format, no seconds ### MMM d,yyyy h:mm:ss a ### // 12-hour format with seconds ### MMM d,yyyy h:mm:ss.S a ### // 12-hour format, seconds & millisec ### MMM d,yyyy a h:mm ### // 12-hour format, no seconds ### MMM d,yyyy a h:mm:ss ### // 12-hour format with seconds ### MMM d,yyyy a h:mm:ss.S ### // 12-hour format, seconds & millisec // Dates in the astronomical format 1969 August 10 ### yyyy MMM d ### // Date only ### yyyy MMM d HH:mm ### // Date and time, 24-hour format ### yyyy MMM d HH:mm:ss ### // Date and time, 24-hour format w/sec ### yyyy MMM d HH:mm:ss.S ### // Date and time, 24-hour format w/ms ### yyyy MMM d h:mm a ### // Date and time, 12-hour format ### yyyy MMM d h:mm:ss a ### // Date and time, 12-hour format ### yyyy MMM d h:mm:ss.S a ### // Date and time, 12-hour format ### yyyy MMM d a h:mm ### // Date and time, 12-hour format ### yyyy MMM d a h:mm:ss ### // Date and time, 12-hour format ### yyyy MMM d a h:mm:ss.S ### // Date and time, 12-hour format // Reversed format 10 August 1969 ### d MMM yyyy ### // Date only ### d MMM yyyy HH:mm ### // Date and time, 24-hour format ### d MMM yyyy HH:mm:ss ### // Date and time, 24-hour format w/sec ### d MMM yyyy HH:mm:ss.S ### // Date and time, 24-hour format w/ms ### d MMM yyyy h:mm a ### // Date and time, 12-hour format ### d MMM yyyy h:mm:ss a ### // Date and time, 12-hour format ### d MMM yyyy h:mm:ss.S a ### // Date and time, 12-hour format ### d MMM yyyy a h:mm ### // Date and time, 12-hour format ### d MMM yyyy a h:mm:ss ### // Date and time, 12-hour format ### d MMM yyyy a h:mm:ss.S ### // Date and time, 12-hour format // Same as above but with AD/BC indicator ### d MMM yyyy G ### // Date only ### d MMM yyyy G HH:mm ### // Date and time, 24-hour format ### d MMM yyyy G HH:mm:ss ### // Date and time, 24-hour format w/sec ### d MMM yyyy G HH:mm:ss.S ### // Date and time, 24-hour format w/ms ### d MMM yyyy G h:mm a ### // Date and time, 12-hour format ### d MMM yyyy G h:mm:ss a ### // Date and time, 12-hour format ### d MMM yyyy G h:mm:ss.S a ### // Date and time, 12-hour format ### d MMM yyyy G a h:mm ### // Date and time, 12-hour format ### d MMM yyyy G a h:mm:ss ### // Date and time, 12-hour format ### d MMM yyyy G a h:mm:ss.S ### // Date and time, 12-hour format // Are the following useful? ### yyyy-MM ### // Year and month ### yyyy/MM ### // Year and month ### G yyyy-MM ### // Year and month ### G yyyy/MM ### // Year and month // This will of course conflict if we ever want to define simply a time // in 2400 format. And damn SimpleDateFormat lets ANY damn thing match this. ### yyyy ### // Year only ### yyyy G ### // Year and AD/BC // The following are time formats with unknown dates. // These will parse generally to "today," but that's really sloppy and // unreliable so include the date if you want to be safe. ### HH:mm:ss.S ### // Full time format with milliseconds (24-hr) ### h:mm:ss.S a ### // Full time format with milliseconds (12-hr) ### a h:mm:ss.S ### // Full time format with milliseconds (12-hr) ### HH:mm:ss ### // Full time format (24-hr) ### h:mm:ss a ### // Full time format (12-hr) ### a h:mm:ss ### // Full time format (12-hr) ### HH:mm ### // Hour and minute (24-hr) ### h:mm a ### // Hour and minute (12-hr) ### a h:mm ### // Hour and minute (12-hr) ### a h ### // AM/PM plus hour (12-hr) ### h a ### // hour plus AM/PM (12-hr) // ISO-8601 Extended formats with literal "T" and colons. // Note that the quotes don't actually appear in the format; they're a way // of escaping literal text. ### yyyy-MM-dd'T'HH:mm:ss.S ### // ISO-8601 format with T with milliseconds ### yyyy-MM-dd'T'HH:mm:ss ### // ISO-8601 format with T with seconds ### yyyy-MM-dd'T'HH:mm ### // ISO-8601 format with T with minutes ### yyyy-MM-dd'T'HH ### // ISO-8601 format with T with hours // RFC-1123 (an update to RFC 822) date format which is used in HTTP headers. // Example: // Last-Modified: Wed, 01 Sep 2004 13:24:52 GMT // // HTTP/1.1 servers and clients are REQUIRED to output this format, but should // parse 3 different formats for compatibility with HTTP/1.0 (not implemented // here.) // See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 // // Alan's editorializing: Needless to say, this is a stupid format. It // uses language-specific month names instead of portable month numbers, // a totally backwards non-sortable order (it should be year-month-day, of // course. Most significant digits should ALWAYS be first,) and has a // redundant and language-specific day of week name which is TOTALLY // unnecessary and can even be contradictory to other provided information if // calculated incorrectly. Also, dates in RFC-1123 are // required to be in "GMT" format (apparently the protocol designers have // never heard of UTC and it's the year 1971.) ### EEE, dd MMM yyyy HH:mm:ss ### // You can also define the default output format with 4 pound signs. // Without any definition, you get the Java default (which should theoretically // get it from your system's settings,) but the following gives lots of // information: #### G yyyy-MM-dd a hh:mm:ss.SSS (E) zzzz #### // Make it so we can parse the default output format, in old and new formats, // with and without timezones. ### G yyyy-MM-dd hh:mm:ss.S a (E) zzzz ### ### G yyyy-MM-dd a hh:mm:ss.S (E) zzzz ### ### G yyyy-MM-dd hh:mm:ss.S a (E) ### ### G yyyy-MM-dd a hh:mm:ss.S (E) ###