Converts the given datestring into a unix-timestamp.

datestring_to_unix(datestring, in_format = "%Y-%m-%d")

Arguments

datestring

The date to convert given as a string of the specified in_format.

in_format

The format code of the given datestring. For the specification see section "Details" in help(strptime)

Value

Integer representing the date as a unix_timestamp.

Examples

datestring_to_unix("1970-01-01")
#> [1] 0
# 0 datestring_to_unix("1970-01-02")
#> [1] 86400
# 86400