date_fun: Date function to convert character/other as.POSIXct to date.

View source: R/date_fun.R

date_funR Documentation

Date function to convert character/other as.POSIXct to date.

Description

Date function to convert character/other as.POSIXct to date.

Usage

date_fun(x, tz = "EST", form = "%F")

Arguments

x

as.POSIXct or as.character

tz

timezone (default set to Eastern Standard Time)

form

format (default set to YYYY-mm-dd)

Value

Helper function to format date (and date-time) fields

Examples

datetime=as.character(c("2015-05-01 08:00:00","2015-10-15 12:00:00","2015-10-15 5:00:00"))
date_fun(datetime);# just date
date_fun(datetime, form="%F %X"); #include date and time

SwampThingPaul/AnalystHelper documentation built on May 15, 2024, 1:32 p.m.