bt_guess_date: Guesses the date from a string

View source: R/bt_guess_date.R

bt_guess_dateR Documentation

Guesses the date from a string

Description

Feed me a string with a date and I'll try to return a date formatted value.

Usage

bt_guess_date(tgt.string)

Arguments

tgt.string

a string containing a potential date in the appropriate format

Details

The target string should contain a day value as a 1- or 2-digit number, a year as a 4-digit number and a month as a word (e.g. 'December').

The month guessing uses bt_guess_month() and thus supports all the languages which that function can use.

I have not seen any instances where the date is stored with the year as two digits. If this is problematic I can implement something to catch these cases.

Value

date in date format

Examples

bt_guess_month("23eme Aout, 2021")
#returns "2021-08-23"

global-trade-alert/gtabastiat documentation built on June 4, 2023, 6:40 a.m.