parse_datetime: Parse a vector of date-time strings and convert to the...

View source: R/utils-parsers.R

parse_datetimeR Documentation

Parse a vector of date-time strings and convert to the desired time-zone.

Description

This function assumes that it is being given date-time strings in the UTC/GMT time-zone with a specific format. The format is similar to ISO-8601, but it omits the "T" dividing the date and time: ⁠YYYY-MM-DD hh:mm:ss.sss⁠. For example, the date-time May 1, 1983 at 3:33PM and 44.444 seconds, would be represented as ⁠1983-05-01 15:33.444⁠. After parsing those strings as date-times, the time-zone is converted to the desired zone.

Usage

parse_datetime(x, time_zone = "UTC")

Arguments

x

The character vector to convert.

time_zone

The time zone to use when parsing date-time objects (see timezones).

Value

A vector of date-times, where the date-time has been converted to the desired time-zone.


UCLATALL/CourseKataData documentation built on Dec. 4, 2023, 2:25 a.m.