round.POSIXt              package:base              R Documentation

_R_o_u_n_d / _T_r_u_n_c_a_t_e _D_a_t_a-_T_i_m_e _O_b_j_e_c_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Round or truncate date-time objects.

_U_s_a_g_e:

     round(x, units=c("secs", "mins", "hours", "days"))
     trunc.POSIXt(x, units=c("secs", "mins", "hours", "days"))

_A_r_g_u_m_e_n_t_s:

       x: an object inheriting from `"POSIXt"'.

   units: one of the units listed.  Can be abbreviated.

_D_e_t_a_i_l_s:

     The time is rounded or truncated to the second, minute, hour or
     day. Timezones are only relevant to days, when midnight in the
     current timezone is used.

_V_a_l_u_e:

     An object of class `"POSIXlt"'.

_N_o_t_e:

     `trunc' is not generic, so `trunc.POSIXt' has to be called
     explicitly.

_S_e_e _A_l_s_o:

     `DateTimeClasses'

_E_x_a_m_p_l_e_s:

     round(.leap.seconds + 1000, "hour")
     trunc.POSIXt(Sys.time(), "day")

