Search code examples
datedatetimemaskdatetime-format

Is there a standard name for the date format dd-MMM-yyyy? For example 01-Oct-2013


I made a Java enum of standard date and time formats but I want the names to be the format mask where possible or the name of the standard. Since dd-MMM-yyyy is not a valid variable name, I'd like to name it the standard. For example, I have an entry called ISO8601 for yyyy-MM-dd'T'HH:mm:ss.SSS and another called TSQL6 for dd MMM yy. Is there a standard name for the format dd-MMM-yyyy? I see that dd-MMM-yyyy and dd-MMM-yy show up a lot in PL/SQL but I haven't seen a code or name assigned to them the way T-SQL has numeric codes assigned to all of the convert options for dates for use in the convert function.


Solution

  • The dd-mmm-yyyy format is specified in RFC 5322 "Internet Message Format":

    3.3. Date and Time Specification

    Date and time values occur in several header fields. This section specifies the syntax for a full date and time specification. Though folding white space is permitted throughout the date-time specification, it is RECOMMENDED that a single space be used in each place that FWS appears (whether it is required or optional); some older implementations will not interpret longer sequences of folding white space correctly.

    date-time = [ day-of-week "," ] date time [CFWS]

    day-of-week = ([FWS] day-name) / obs-day-of-week

    day-name = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun"

    date = day month year

    day = ([FWS] 1*2DIGIT FWS) / obs-day

    month = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" / "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"

    year = (FWS 4*DIGIT FWS) / obs-year

    So if you really wanted a formal name for it, e.g. for specification documents, you could call it an RFC 5322 date.