# Period-class

0th

Percentile

##### Period class

Period is an S4 class that extends the Timespan-class class. Periods track the change in the "clock time" between two date-times. They are measured in common time related units: years, months, days, hours, minutes, and seconds. Each unit except for seconds must be expressed in integer values.

##### Details

The exact length of a period is not defined until the period is placed at a specific moment of time. This is because the precise length of one year, month, day, etc. can change depending on when it occurs due to daylight savings, leap years, and other conventions. A period can be associated with a specific moment in time by coercing it to an Interval-class object with as.interval or by adding it to a date-time with "+".

Periods provide a method for measuring generalized timespans when we wish to model clock times. Periods will attain intuitive results at this task even when leap years, leap seconds, gregorian days, daylight savings changes, and other events happen during the period. See Duration-class for an alternative way to measure timespans that allows precise comparisons between timespans.

Period class objects have six slots. 1) .Data, a numeric object. The apparent amount of seconds to add to the period. 2) minute, a numeric object. The apparent amount of minutes to add to the period. 3) hour, a numeric object. The apparent amount of hours to add to the period.4) day, a numeric object. The apparent amount of days to add to the period.5) month, a numeric object. The apparent amount of months to add to the period. 6) year, a numeric object. The apparent amount of years to add to the period.

##### Aliases
• !=,Duration,Period-method
• !=,Period,Duration-method
• !=,Period,Period-method
• $,Period-method •$<-,Period-method
• *,ANY,Period-method
• *,Period,ANY-method
• +,Date,Period-method
• +,POSIXct,Period-method
• +,POSIXlt,Period-method
• +,Period,Date-method
• +,Period,Duration-method
• +,Period,Interval-method
• +,Period,POSIXct-method
• +,Period,POSIXlt-method
• +,Period,Period-method
• +,Period,difftime-method
• +,Period,numeric-method
• +,difftime,Period-method
• +,numeric,Period-method
• -,ANY,Period-method
• -,Period,missing-method
• /,Period,Duration-method
• /,Period,Interval-method
• /,Period,Period-method
• /,Period,difftime-method
• /,Period,numeric-method
• /,difftime,Period-method
• /,numeric,Period-method
• <,Duration,Period-method
• <,Period,Duration-method
• <,Period,Period-method
• <=,Duration,Period-method
• <=,Period,Duration-method
• <=,Period,Period-method
• ==,Duration,Period-method
• ==,Period,Duration-method
• ==,Period,Period-method
• >,Duration,Period-method
• >,Period,Duration-method
• >,Period,Period-method
• >=,Duration,Period-method
• >=,Period,Duration-method
• >=,Period,Period-method
• Period-class
• [,Period-method
• [<-,Period,ANY,ANY,Period-method
• %%,Period,Duration-method
• %%,Period,Interval-method
• %%,Period,Period-method
• as.difftime,Period-method
• as.numeric,Period-method
• c,Period-method
• rep,Period-method
• show,Period-method
Documentation reproduced from package lubridate, version 1.2.0, License: GPL

### Community examples

Looks like there are no examples yet.