str_datetime_to_unixtime: Convert a date-time string to unix time

View source: R/harp_dates.R

str_datetime_to_unixtimeR Documentation

Convert a date-time string to unix time

Description

This is a convenient wrapper for the YMD..2unix functions

Usage

str_datetime_to_unixtime(str_datetime)

str_datetime_to_datetime(str_datetime)

Arguments

str_datetime

A date-time string - its format is guessed from the number of characters in the string: 8 = YYYYMMDD, 10 = YYYYMMDDHH, 12 = YYYYMMDDHHmm. May be passed as a character string or numeric.

Value

The unix time in seconds since 01/01/1970 00:00:00

Examples

str_datetime_to_unixtime("20170101")
str_datetime_to_unixtime(2017010112)
str_datetime_to_unixtime("201701011230")

str_datetime_to_datetime("20170101")
str_datetime_to_datetime(2017010112)
str_datetime_to_datetime("201701011230")

andrew-MET/harpIO documentation built on March 7, 2024, 7:48 p.m.