date (version 1.2-38) Coerce Data to Dates


Converts any of the following character forms to a Julian date: 8/31/56, 8-31-1956, 31 8 56, 083156, 31Aug56, or August 31 1956.

Usage, order = "mdy", ...)



input data vector.


if x is character, defines the order in which the terms are assumed to appear in a xx/xx/xx date. The default is month/day/year; any permutation of mdy is legal.


if x is character, then any other arguments from can be used as well.


For each date, the number of days between it and January 1, 1960. The date will be missing if the string is not interpretable.


If x is numeric, then floor(x) is returned, e.g., is the same as and gives February 5, 1960 (5Feb60). If x is character, the program attempts to parse it.

See Also, date.mmddyy, date.ddmmmyy


Run this code
# NOT RUN {"1jan1960", "2jan1960", "31mar1960", "30jul1960"))
# }

Run the code above in your browser using DataLab