Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

period_to_seconds

Contrive a period to/from a given number of seconds


Description

period_to_seconds() approximately converts a period to seconds assuming there are 365.25 days in a calendar year and 365.25/12 days in a month.

seconds_to_period() create a period that has the maximum number of non-zero elements (days, hours, minutes, seconds). This computation is exact because it doesn't involve years or months.

Usage

period_to_seconds(x)

seconds_to_period(x)

Arguments

x

A numeric object. The number of seconds to coerce into a period.

Value

A number (period) that roughly equates to the period (seconds) given.


lubridate

Make Dealing with Dates a Little Easier

v1.7.10
GPL (>= 2)
Authors
Vitalie Spinu [aut, cre], Garrett Grolemund [aut], Hadley Wickham [aut], Ian Lyttle [ctb], Imanuel Costigan [ctb], Jason Law [ctb], Doug Mitarotonda [ctb], Joseph Larmarange [ctb], Jonathan Boiser [ctb], Chel Hee Lee [ctb], Google Inc. [ctb, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.