guess_date_format: Guesses the format of a date in a string.

Description Usage Arguments Examples

Description

Matches date components using a simple heuristic and leaves the other elements of the string untouched.

Usage

1
  guess_date_format(string, default = "mdy")

Arguments

a

string consisting of date components

Examples

1
2
3
4
5
6
7
8
9
guess_date_format("Jan 1, 1999")           #= "%b %e, %Y"
guess_date_format("Jan 2001")              #= "%b %Y"
guess_date_format("Sunday, May 1, 2000")   #= "%A, %B %e, %Y"
guess_date_format("Sun Aug 5")             #= "%a %b %e"
guess_date_format("12/31/99")              #= "%m/%d/%y"
guess_date_format("DOB:12/11/00")          #= "DOB:%m/%d/%y"
guess_date_format('20 01 89')              #= "%d %m %y"
guess_date_format('1 13 89')               #= "%m %d %y"
guess_date_format('00/13/10')              #= "%y/%d/%m"

ramnathv/intellidate documentation built on May 26, 2019, 10:14 p.m.