date_type: Format dates

View source: R/date_type.R

date_typeR Documentation

Format dates

Description

Transform dates in "%Y%m%d" format, i.e. with date formats in that order but with arbitrary or no separators, to a specified date format.

Usage

date_type(date, type)

Arguments

date

A date in "%Y%m%d" format.

type

Specifies the format that the date should be returned in, using standard R date types.

Value

A character object.

Examples

date_type("2012-12-31", "%Y")  # returns 2012


moj-analytical-services/mojrap documentation built on July 30, 2023, 4:43 p.m.