parse_date: Attempt to parse a date with common formats

View source: R/date_to_sy.R

parse_dateR Documentation

Attempt to parse a date with common formats

Description

Helper function for date_to_sy. Returns a date object as is, or noisily attempts to parse a string in the form YYYY-MM-DD or MM/DD/YYYY. If the date cannot be parsed, throws an error.

Usage

parse_date(date)

Arguments

date

a character or Date vector to parse

Value

a Date vector, the same length as 'date'


tntpr documentation built on April 3, 2025, 8:48 p.m.