Learn R Programming

⚠️There's a newer version (1.9.4) of this package.Take me there.

lubridate (version 1.5.0)

Make Dealing with Dates a Little Easier

Description

Functions to work with date-times and timespans: fast and user friendly parsing of date-time data, extraction and updating of components of a date-time (years, months, days, hours, minutes, and seconds), algebraic manipulation on date-time and timespan objects. The 'lubridate' package has a consistent and memorable syntax that makes working with dates easy and fun.

Copy Link

Version

Install

install.packages('lubridate')

Monthly Downloads

916,030

Version

1.5.0

License

GPL

Maintainer

Vitalie Spinu

Last Published

December 2nd, 2015

Functions in lubridate (1.5.0)

hm

Create a period with the specified number of hours and minutes
int_shift

Shift an interval along the timeline
day

Get/set days component of a date-time.
as.period

Change an object to a period.
dst

Get Daylight Savings Time indicator of a date-time.
DateUpdate

Changes the components of a date object
interval

Create an interval object.
decimal_date

Converts a date to a decimal of its year.
add_epoch_to_date

Add epochs to dates
guess_formats

Guess formats from the supplied date-time character vector.
reclass_timespan

Convenience method to reclass timespans post-modification.
as.duration

Change an object to a duration.
second

Get/set seconds component of a date-time.
int_overlaps

Test if two intervals overlap
int_length

Get the length of an interval in seconds
int_start

Access and change the start date of an interval
%within%

Tests whether a date or interval falls within an interval
reclass_date

Convenience method to reclass dates post-modification.
time_length

Compute the exact length of a time span.
hms

Create a period with the specified hours, minutes, and seconds
is.difftime

Is x a difftime object?
here

The current time in your local timezone
as.interval

Change an object to an interval.
duration

Create a duration object.
force_tz

Replace time zone to create new date-time
is.POSIXt

Is x a POSIXct or POSIXlt object?
Period-class

Period class
DateCoercion

Convert a variety of date-time classes to POSIXlt and POSIXct
parse_date_time

Parse character and numeric date-time vectors with user friendly order formats.
origin

1970-01-01 UTC
new_epoch

Create an epoch object
olson_time_zones

Names of available time zones
ymd_hms

Parse dates that have hours, minutes, or seconds elements.
quick_durations

Quickly create duration objects.
lakers

Lakers 2008-2009 basketball data set
quick_periods

Quickly create period objects.
stamp

Format dates and times based on human-friendly templates.
%m+%

Add and subtract months to a date without exceeding the last day of the new month
Timespan-class

Timespan class
round_date

Round, flour and ceiling methods for date-time objects.
is.timespan

Is x a length of time?
is.instant

Is x a date-time object?
Deprecated-lubridate

Deprecated function in lubridate package
period_to_seconds

Contrive a period to/from a given number of seconds.
int_aligns

Test if two intervals share an endpoint
lubridate-package

Dates and times made easy with lubridate
Interval-class

Interval class
int_diff

Extract the intervals within a vector of date-times
ymd

Parse dates according to the order in that year, month, and day elements appear in the input vector.
am

Does date time occur in the am or pm?
now

The current time
week

Get/set weeks component of a date-time.
date_decimal

Converts a decimal to a date.
fit_to_timeline

Fit a POSIXlt date-time to the timeline
rollback

Roll back date to last day of previous month
ms

Create a period with the specified number of minutes and seconds
quarter

Get the fiscal quarter of a date-time.
tz

Get/set time zone component of a date-time.
quick_epochs

Quickly create common epoch objects
int_end

Access and change the end date of an interval
int_standardize

Ensures all intervals in an interval object are positive
leap_year

Is a year a leap year?
is.Date

Is x a Date object?
make_difftime

Create a difftime object.
with_tz

Get date-time in a different time zone
month

Get/set months component of a date-time.
int_flip

Flip the direction of an interval
year

Get/set years component of a date-time.
period

Create a period object.
pretty_dates

Computes attractive axis breaks for date-time data
days_in_month

Get the number of days in the month of a date-time.
Duration-class

Duration class
minute

Get/set minutes component of a date-time.
hour

Get/set hours component of a date-time.
today

The current date
timespan

Description of time span classes in lubridate.