All Projects → tidyverse → Lubridate

tidyverse / Lubridate

Licence: gpl-3.0
Make working with dates in R just that little bit easier

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Lubridate

Date Info
API to let user fetch the events that happen(ed) on a specific date
Stars: ✭ 7 (-98.72%)
Mutual labels:  date, date-time
Calendarview
An Easy to Use Calendar for iOS (Swift 5.0)
Stars: ✭ 429 (-21.86%)
Mutual labels:  date, date-time
Moment Range
Fancy date ranges for Moment.js
Stars: ✭ 1,639 (+198.54%)
Mutual labels:  date, date-time
Swiftdate
🐔 Toolkit to parse, validate, manipulate, compare and display dates, time & timezones in Swift.
Stars: ✭ 6,661 (+1113.3%)
Mutual labels:  date, date-time
Time
Building a better date/time library for Swift
Stars: ✭ 1,983 (+261.2%)
Mutual labels:  date, date-time
Maya
Datetimes for Humans™
Stars: ✭ 3,298 (+500.73%)
Mutual labels:  date
Date Fns Tz
Complementary library for date-fns v2 adding IANA time zone support
Stars: ✭ 385 (-29.87%)
Mutual labels:  date
Timestamp
⏰ A better macOS menu bar clock.
Stars: ✭ 296 (-46.08%)
Mutual labels:  date
Timeago.dart
A library useful for creating fuzzy timestamps. (e.g. "5 minutes ago")
Stars: ✭ 293 (-46.63%)
Mutual labels:  date
Joda Time
Joda-Time is the widely used replacement for the Java date and time classes prior to Java SE 8.
Stars: ✭ 4,736 (+762.66%)
Mutual labels:  date-time
Knptimebundle
Provides helpers for time manipulation
Stars: ✭ 459 (-16.39%)
Mutual labels:  date
Date Io
Abstraction over common javascript date management libraries
Stars: ✭ 382 (-30.42%)
Mutual labels:  date
Time
Simple time handling in Rust
Stars: ✭ 334 (-39.16%)
Mutual labels:  date
Pandas market calendars
Exchange calendars to use with pandas for trading applications
Stars: ✭ 319 (-41.89%)
Mutual labels:  date
Pendulum
Python datetimes made easy
Stars: ✭ 4,639 (+744.99%)
Mutual labels:  date
React Datetime Picker
A datetime picker for your React app.
Stars: ✭ 294 (-46.45%)
Mutual labels:  date
Mdatepickerview
Quick and easy date picker.
Stars: ✭ 373 (-32.06%)
Mutual labels:  date
Ciso8601
Fast ISO8601 date time parser for Python written in C
Stars: ✭ 455 (-17.12%)
Mutual labels:  date-time
Zebra datepicker
A super-lightweight, highly configurable, cross-browser date / time picker jQuery plugin
Stars: ✭ 367 (-33.15%)
Mutual labels:  date
Human Interval
Human readable time distances for javascript
Stars: ✭ 360 (-34.43%)
Mutual labels:  date

lubridate

CRAN version R build status Coverage Status CRAN RStudio mirror downloads Development version

Overview

Date-time data can be frustrating to work with in R. R commands for date-times are generally unintuitive and change depending on the type of date-time object being used. Moreover, the methods we use with date-times must be robust to time zones, leap days, daylight savings times, and other time related quirks, and R lacks these capabilities in some situations. Lubridate makes it easier to do the things R does with date-times and possible to do the things R does not.

If you are new to lubridate, the best place to start is the date and times chapter in R for data science.

Installation

# The easiest way to get lubridate is to install the whole tidyverse:
install.packages("tidyverse")

# Alternatively, install just lubridate:
install.packages("lubridate")

# Or the the development version from GitHub:
# install.packages("devtools")
devtools::install_github("tidyverse/lubridate")

Cheatsheet

Features

library(lubridate, warn.conflicts = FALSE)
  • Easy and fast parsing of date-times: ymd(), ymd_hms, dmy(), dmy_hms, mdy(), …

    ymd(20101215)
    #> [1] "2010-12-15"
    mdy("4/1/17")
    #> [1] "2017-04-01"
    
  • Simple functions to get and set components of a date-time, such as year(), month(), mday(), hour(), minute() and second():

    bday <- dmy("14/10/1979")
    month(bday)
    #> [1] 10
    wday(bday, label = TRUE)
    #> [1] Sun
    #> Levels: Sun < Mon < Tue < Wed < Thu < Fri < Sat
    
    year(bday) <- 2016
    wday(bday, label = TRUE)
    #> [1] Fri
    #> Levels: Sun < Mon < Tue < Wed < Thu < Fri < Sat
    
  • Helper functions for handling time zones: with_tz(), force_tz()

    time <- ymd_hms("2010-12-13 15:30:30")
    time
    #> [1] "2010-12-13 15:30:30 UTC"
    
    # Changes printing
    with_tz(time, "America/Chicago")
    #> [1] "2010-12-13 09:30:30 CST"
    
    # Changes time
    force_tz(time, "America/Chicago")
    #> [1] "2010-12-13 15:30:30 CST"
    

Lubridate also expands the type of mathematical operations that can be performed with date-time objects. It introduces three new time span classes borrowed from https://www.joda.org.

  • durations, which measure the exact amount of time between two points

  • periods, which accurately track clock times despite leap years, leap seconds, and day light savings time

  • intervals, a protean summary of the time information between two points

Code of Conduct

Please note that the lubridate project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].