# DateValue returns inconsistent types

More of a 'why' than a 'how' question...

DateValue[{2014,4,12},"DayName"]


returns Saturday, a symbol rather than the string "Saturday".

Every other result that DateValue returns that is not a number is a string not a symbol so why the special case for Days of the Week?

Just to add to the confusion DayNameShort and DayNameInitial do return strings.

As shown inthe documentation, the third parameter of DateValue provides control of the form of the value returned. If you want a String specify that.

DateValue[{2014, 4, 12}, "DayName", String]


"Saturday"

Head[%]


String

• Hmm, despite staring at the docs for a long time I seem to have deliberately ignored that one. Many thanks as that solves a different problem as well. – Ymareth Mar 31 '15 at 10:13
• +1. Somewhat related. Any reason that the day names are available as Symbols as well as Strings, but the month names only as Strings? – Romke Bontekoe Mar 17 '19 at 8:31
• @RomkeBontekoe - I don't know why Wolfram (company) decided to build in definitions for days as symbols but not months. DateValue is then consistent with that decision. – Bob Hanlon Mar 17 '19 at 12:31