sim_time: Time part of a sim_datetime

Description Usage Arguments Value Examples

Description

sim_time() returns the time of a sim_datetime in seconds. The beginning of a day is defined by the time component of origin_date which defines the parameter sim_datetime.

Usage

1
sim_time(sim_datetime)

Arguments

sim_datetime

A sim_datetime (integer representing the passed seconds since origin_date)

Value

time in seconds (Range: 0-(24*60*60-1))

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sim_time(200)
# [1] 200
sim_time(24*60*60-1)
# [1] 86399
sim_time(24*60*60)
# [1] 0
origin_date <- as.POSIXct("2016-01-01 00:00:00", tz = "UTC")
sim_time(as.sim_datetime(as.POSIXct("2016-01-01 00:01:00", tz = "UTC"), origin_date))
# [1] 60
sim_time(as.sim_datetime(as.POSIXct("2016-01-02 00:01:00", tz = "UTC"), origin_date))
# [1] 60

simtimer documentation built on May 2, 2019, 2:26 p.m.