Learn R Programming

KarsTS (version 2.4.1)

findDateFormat: findDateFormat: finds the format of a set of dates

Description

This function identifies the format of a set of dates from a list of allowed formats.

Usage

findDateFormat(X, tz = NULL)

Arguments

X

The date (given as a character string)

tz

The time zone

Value

It returns the date format, ready to use in the funtion strptime. If the dates have different formats, the function returns "variousFormats". If the format is not one of the allowed ones, it returns "notAllowedformat".

Details

The allowed formats are: "%m/%d/%Y %H:%M", "%Y/%m/%d %H:%M","%Y-%m-%d %H:%M" and "%m-%d-%Y %H:%M"