Make working with dates in R just that little bit easier
force_tzs
for "enforcement" of heterogeneous time zones.local_time
for the retrieval of local day time in different time zones.cutoff_2000
for parsing functions to indicate 20th century cutoff for y
format.week_start
parameter in wday
and wday<-
to set week start.locale
in wday
. Labels of the returned factors (when label=TRUE
) now respect current locale.locale
in month
. Labels of the returned factors (when label=TRUE
) now respect current locale.quarter
gained a new argument fiscal_start
to address the issue of different fiscal conventions.epiweek
and epiyear
.week_start
to floor_date
, ceiling_date
and round_date
.season
is now supported.as_date
and as_datetime
now understand character vectors.parse_date_time
- train=TRUE
and drop=FALSE
which allow more refined control of the format guessing. Formats are no longer dropped in the process by default, process which resulted in surprising behavior on several occasions (#516,#308,#307).wday
and month
are now in current locale. The abbreviated labels in English locales have been changed to standard abbreviations (Tues -> Tue, Thurs -> Thu etc.).with_tz
on invalid timezone.B
and b
formats no longer match numeric months. This corresponds to the original intent, and was always documented as such.days
, dhours
, round_date
work when the methods package is not loaded.wday
work on character inputs as it is the case with all other day accessors.y
format when it's the last in format order (as in mdy
).m
and b
formats now works correctly.date()
when called with missing argument.NA
properly.make_datetime
respects tz
argument and is much faster now.day<-
, minute<-
, etc. from producing an error when length(x) is 0 (issue #517)parse_date_time
now throw warnings only for actual parsing errors (input with all NAs are silent)semester
to extract semesters form date-time objects.period
and duration
constructors now accept string as first argument. Same parsing rules apply to the 'unit' parameter in rounding functions.hms
, hm
, ms
gained new argument roll=TRUE
which rolls minutes and seconds bigger than 59 towards higher units.round_date
, floor_date
and ceiling_date
now support rounding to multiple of units.yq
for parsing most common version of quarter strings.q
for parsing quarters in all lubridate parsing functions.as_datetime
to coerce to POSIXct object. A counterpart of as_date
.make_date
to produce Date objects. A counterpart of make_datetime
.ceiling_date
for Date
objects was changed to what most of the users expect. Rounding up by months now produces first day of the next months even for first day of the month.round_date
, ceiling_date
, and floor_date
now accept "quarter", "bimonth", and "halfyear" as unit
options.parse_date_time
and related functions are now deprecated.pretty.*
family of functions were renamed and are no longer exported. If you need to use them, use lubridate:::pretty_*
versions.change_on_boundary
argument in ceiling_date
does not allow for global option anymore.as.duration
, as.numeric
don't show "only estimate" messages on conversion from periods. The occasional approximate conversion is documented and deemed common knowledge.as.numeric
with unit="month"
now works on duration objects.Date
objects now return POSIXct
instead of POSIXlt
.mdy
or myd
beginning with "January"
or "Jan"
now parsing correctlyhere
and olson_time_zones
were deprecated in favor of new
and base OlsonNames
respectively.period
and duration
constructors.date_decimal
and decimal_date
.as.numeric
correctly converts periods to (approximate) numeric time lengths.ceiling_date
gains new argument change_on_boundary
to allow ceiling on boundary of date-time objects.parse_date_time2
and fast_strptime
gain new lt
argument to control type of output.date
and date<-
additions to the year
, month
etc family of accessors.make_datetime
(dropin replacement of ISOdatetime
).force_tz
and with_tz
can handle data.frames component-wise.as_date
replacement of as.Date
with more intuitive behavior with non-UTC timezones.hms
parsers now handle negative components.ymd
family of functions return Date
object when tz
argument is NULL (new default) and POSIXct otherwise.base:strptime
fast_strptime
now returns POSIXlt
object. That is, its lt
argument defaults to TRUE
.interval
constructor treats timezones correctly and works with UTC whenever meaningful.as.period
correctly computes months with intervals spanning multiple years.time_length
and add_with_rollback
now work correctly with missing intervals.fast_strptime
and parse_date_time2
correctly treat non-UTC time zones.floor_date
and round_date
are not preserving tz component for larger than day unitsThis is a extensive bug fix release with no major known bugs left. The lubridate
package should be now faster, more stable and more user friendly.
There are two notable changes to the UI. First, new_zzz
style constructors, such as new_interval
, new_period
etc., were absorbed by interval
, period
etc. constructors without affecting the flexibility or backward compatibility. Second, new argument exact
to parse_date_time
allows direct specification of the formats and thus avoids guessing and training of the formats behind the scene.
time_length
method.isoyear
function to line up with isoweek
.exact = TRUE
option to parse_date_time
for faster and much more flexible specification of
formats.simple
argument to fit_to_timeline
and update
methods mostly
intended for internal use.unique
method for interval
classpreserve_hms
and roll_to_first
in rollback
function.quarter
option in floor_date
and friends.as.list.Interval
S3 method.qday
(quarter day).new_interval
, new_period
,
new_duration
, new_difftime
were deprecated in favour of the more powerful
interval
, period
, duration
and make_difftime
functions.eseconds
, eminutes
etc. were deprecated in favour of dsecons
, dminutes
etc.test/testthat
.isodate
was replaced with a much faster parse_date_time2(paste(...))
alternativeLubridate
's trunc
,
ceiling
and floor
functions have been optimised and now are relying on R's
trunc.POSIXct
whenever possible.fst
objects.enc2utf8
.int_standardize
ceiling_date
skip day light gap.preproc_wday=T
.parse_date_time
.fit_to_timeline
function.isoweek
computationseconds_to_period
.$<-
assignment for periods are now properly recycled.round_date
.time-zones.R
in coercion.R
.standardise_lt_names
.as.period.period
if unit != NULL
.as.period.interval
without recurring to modulo arithmetic.hms
, hm
and ms
for new printing style.guess_formats
now matches flex regexp first.dmilliseconds
now correctly returns a Duration
object.