guessDateFormat: Determine Format of Date and Date-Time Variables
Description
Given a vector of dates or date-times, determine the format if one is used
consistently. If inconsistentencies are found, the function will fail.
See strptime for examples of format specifications.
Usage
guessDateFormat(x)
Arguments
x
character vector of dates or date-times
Value
Returns a character string representing the format of the date-time
variables.
Details
guessDateFormat is rigid when determining the date format. For
date-times it expects the date and time parts to be separated by a space. It
does not recognize all format specifications, such as the AM/PM indicator.
The time part should have at least one colon to separate hours from minutes.
The date part may have any separator as non-numerical values are removed
before parsing.