A new release of the anytime package arrived on CRAN today—the first is well over four years. The package is fairly feature-complete, and code and functionality remain mature and stable, of course.
anytime
is a very focused package aiming to do just one thing really
well: to convert anything in integer, numeric, character,
factor, ordered, … input format to either POSIXct (when called as
anytime
) or Date objects (when called as
anydate
) – and to do so without requiring a format
string as well as accomodating different formats in one input
vector. See the anytime page,
or the GitHub repo
for a few examples, and the beautiful documentation site
for all documentation.
This release slowly matured over four years. It combines a number of strictly internal repository maintenance such as changes to continuous integration with small enhancements (adding for example some new formats, responding better to an error condition, dealing with logical input as an error) with a relaxation of the C++ compilation standard. While we once needed C++11, it is now a constraint as as R itself is quite proactive (the last two releases defaulted already to C++17, suitable compiler permitting) we can now relax this constraint. The documentation site is new, as some other small changes. See the full list of changes which follows.
Changes in anytime version 0.3.10 (2024-12-02)
A new documentation site was added.
Continuous Integration now uses
run.sh
from r-ci with bspmLogical input vectors are now recognised as an error (#121)
Additional dot-separated format
'%Y.%m.%d'
is supportedOther small updates were made throughout the package
No longer set a C++ compilation standard as the default choices by R are sufficient for the package
Switch Rcpp include file to Rcpp/Lightest
We recommend
~/.R/Makevars
compiler flag options-Wno-ignored-attributes -Wno-nonnull -Wno-parentheses
The tinytest runner was simplified
NA
values from conversion now trigger a warning
Courtesy of my CRANberries, there is also a diffstat report of changes relative to the previous release. The issue tracker tracker off the GitHub repo can be use for questions and comments. More information about the package is at the package page, the GitHub repo and the documentation site. If you like this or other open-source work I do, you can now sponsor me at GitHub.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A new minor release of the anytime package arrived on CRAN yesterday. This is the twentieth release, but sadly we seem to be spinning our wheels just accomodating CRAN (which the two or three last releases focused on). Code and functionality remain mature and stable, of course.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, … format to either POSIXct or Date objects – and to do so without requiring a format string as well as accomodating different formats in one input vector. See the anytime page, or the GitHub README.md for a few examples.
This release once again has to play catchup with CRAN as r-devel now changes how tzone
propagates when we do as.POSIXct(as.POSIXlt(Sys.time())
— which is now no longer “equal” to as.POSIXct(Sys.time())
even for a fixed, stored Sys.time()
call result. Probably for the better, but an issue for now so we … effectively just reduced test coverage. Call it “progress”.
The full list of changes follows.
Changes in anytime version 0.3.9 (2020-08-26)
Skip one test file that is impossible to run across different CRAN setups, and life is definitely too short for these games.
Change remaining http:// to https:// because, well, you know.
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page. The issue tracker tracker off the GitHub repo can be use for questions and comments.
If you like this or other open-source work I do, you can now sponsor me at GitHub. For the first year, GitHub will match your contributions.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A new minor release of the anytime package arrived on CRAN overnight. This is the nineteenth release, and it comes just over six months after the previous release giving further indicating that we appear to have reached a nice level of stability.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, … format to either POSIXct or Date objects – and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.
This release mostly plays games with CRAN. Given the lack of specification for setups on their end, reproducing test failures remains, to put it mildly, “somewhat challenging”. So we eventually gave up—and weaponed up once more and now explicitly test for the one distribution where tests failed (when they clearly passed everywhere else). With that we now have three new logical predicates for various Linux distribution flavours, and if that dreaded one is seen in one test file the test is skipped. And with that we now score twelve out of twelve OKs. This being a game of cat and mouse, I am sure someone somewhere will soon invent a new test…
The full list of changes follows.
Changes in anytime version 0.3.8 (2020-07-23)
A small utility function was added to detect the Linux distribution used in order to fine-tune tests once more.
Travis now uses Ubuntu 'bionic' and R 4.0.*.
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page. The issue tracker tracker off the GitHub repo can be use for questions and comments.
If you like this or other open-source work I do, you can now sponsor me at GitHub. For the first year, GitHub will match your contributions.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A fresh minor release of the anytime package is arriving on CRAN right now. This is the eighteenth release, and it comes roughly five months after the previous showing the relative feature-stability we have now.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, … format to either POSIXct or Date objects – and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.
This release brings a clever new option, thanks to Stephen Froehlich. If you know your input has (lots) of duplicates you can now say so and anytime()
(and the other entry points for times and dates, UTC or not) will only parse the unique entries leading to potentially rather large speed gains (as in Stephen’s case where he often has more than 95% of the data as duplicates). We also tweaked the test setup some more, but as we are still unable to replicate what is happening with the Fedora test boxen at CRAN due to the non-reproducible setup so this remains a bit of guess work. Lastly, I am making use of a new Rcpp #define
to speed up compilation a little bit too.
The full list of changes follows.
Changes in anytime version 0.3.7 (2019-01-20)
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page. The issue tracker tracker off the GitHub repo can be use for questions and comments.
If you like this or other open-source work I do, you can now sponsor me at GitHub. For the first year, GitHub will match your contributions.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A fresh and very exciting release of the anytime package is arriving on CRAN right now. This is the seventeenth release, and it comes pretty much exactly one month after the preceding 0.3.5 release.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, … format to either POSIXct or Date objects – and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.
This release updates a number of things (see below for details). For users, maybe the most important change is that we now also convert single-digit months, i.e. a not-quite ISO input like “2019-7-5” passes. This required adding %e
as a month format; I had overlooked this detail in the (copious) Boost date_time documentation. Another nice change is that we now use standard S3 dispatching rather a manual approach as we probably should have for a long time :-) but better late than never. The code change was actually rather minimal and done in a few minutes. Another change is a further extended use of unit testing via the excellent tinytest package which remains a joy to use. We also expanded the introductory pdf vignette; the benchmark comparisons we included look pretty decent for anytime which still combines ease of use and versability with performance.
Lastly, a somewhat sad “lowlight”. We submitted the package to the Journal of Open Source Software who then told us within days of the unworthyness of anytime for lack of research focus. Needless to see, we disagree. So here is plea: If you use anytime in a research setting, would you mind adding to the this very issue ticket and saying so? This may permit us a somewhat more emphatic data-driven riposte to the editors. Many thanks in advance for considering this.
The full list of changes follows.
Changes in anytime version 0.3.6 (2019-08-29)
Added, and then removed, required file for JOSS; added 'unworthy' badge as we earned a desk reject (cf #1605 there).
Renamed internal helper function format() to fmt() to avoid clashes with base::format() (Dirk in #104).
Use S3 dispatch and generics for key functions (Dirk in #106).
Continued to tweak tests as we find some of the rhub platform to behave strangely (Dirk via commits as well as #107).
Added
%e
format for single-digit day parsing by Boost (Dirk addressing at least #24, #70 and #99).Expansed and updated vignette with benchmark comparisons.
Updated unit tests using tinytest which remains a pleasure to use; versioned Suggests: is now '>= 1.0.0'.
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page. The issue tracker tracker off the GitHub repo can be use for questions and comments.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A new release of the anytime package is arriving on CRAN. This is the sixteenth release, and comes a good month after the 0.3.4 release.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, … format to either POSIXct or Date objects – and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.
This release brings a reworked fallback mechanism enabled via the useR=TRUE
option. Because Windows remains a challenging platform which, among other more important ailments, also does not provide timezone information, we no longer rely on the RApiDatetime package which exposes parts of the R API. This works everywhere where timezone information is available, but less so on Windows. Instead, we now use Rcpp::Function
to call directly back into R. This received a considerable amount of testing, and the package should now work even better when either a timezone is set, or the Windows fallback is used, or both. My thanks to Christoph Sax for patiently testing and helping to debug this, as well as for his two pull requests contributing to this release (even if one of these is now redundant as we no longer use RApiDatetime).
The full list of changes follows.
Changes in anytime version 0.3.5 (2019-07-28)
Fix use of
Rcpp::Function
-accessedSys.setenv()
, name all arguments in call to C++ (Christoph Sax in #95).Relax constraint on Windows testing in several test files (Christoph Sax in #97).
Fix an issue related to
TZ
environment variable setting (Dirk in #101).Change
useR=TRUE
behaviour by directly calling R via Rcpp (Dirk in #103 fixing #96).Several updates to unit testing files aiming for more robust behaviour across platforms.
Updated documentation in manual pages, README and vignette.
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page. The issue tracker tracker off the GitHub repo can be use for questions and comments.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A new minor release of the anytime package is arriving on CRAN. This is the fifteenth release, and first since the 0.3.3 release in November.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, … format to either POSIXct or Date objects – and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.
This release is mostly internal and switches to the excellent new tinytest package, a tweak the iso8601()
format helper which now uses T
between date and time (which is a breaking change with the usual addition of a option to get the old behaviour back) and a little more. The full list of changes follows.
Changes in anytime version 0.3.4 (2019-06-18)
Documentation was updated about a 'Europe/London' conversion issue (#84, inter alia).
The package is now compiled under the C++11 standard.
The package now uses
tinytest
for unit tests.The
iso8601()
function now places a ‘T’ between date and time; an option switches to prior format using a space.The vignette is now pre-made and included as-is in a Sweave document reducing the number of suggested packages.
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page. The issue tracker tracker off the GitHub repo can be use for questions and comments.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A new minor clean-up release of the anytime package arrived on CRAN overnight. This is the fourteenth release, and follows the 0.3.2 release a good week ago.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, … format to either POSIXct or Date objects – and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.
This release really adds the nice new vignette as a vignette—there was a gotcha in the 0.3.2 release—and updates some core documentation in the README.md to correctly show anydata()
on input such as 20160101
(which was an improvement made starting with the 0.3.0 release).
Changes in anytime version 0.3.3 (2018-11-13)
Vignette build quirkyness on Windows resolved so vignette reinstated.
Documentation updated showing correct use of
anydate
(and notanytime
) on input like ‘2016010’ following the 0.3.0 release heuristic change.Set
#define
for Boost to make compilation more quiet.
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page.
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A new minor release of the anytime package arrived on CRAN this morning. This is the thirteenth release, and the first since July as the package has gotten feature-complete.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, … format to either POSIXct or Date objects – and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.
This release adds a nice new vignette, solidifies some code in response to the rchk tests by Tomas Kalibera and updates some tests. We had some last-minute issues with the vignette on Windows, and Josh Ulrich was very helpful with some additional tests. For now, the new vignette is added pre-built.
Changes in anytime version 0.3.2 (2018-11-05)
Added a new vignette introducing the anytime package. Seemingly it cannot be compiled on Windows so included prebuilt.
Some more tests for
anydate
were added along with so code coverage tags.The C++ code was robustified in two places to not trigger
rchk
warnings (#79).Three unit test files which fail on Solaris are now skipping this os as we cannot reproduce or test on this OS (#80).
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page.
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A new minor release of the anytime package is now on CRAN. This is the twelveth release, and the first in a little over a year as the package has stabilized.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, … format to either POSIXct or Date objects – and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.
This release adds a few minor tweaks. For numeric input, the function is now immutable: arguments that are not already cast to a different type (a common use case) are now cloned so that the input is never changed. We also added two assertion helpers for dates and datetimes, a new formatting helper for the (arguably awful, but common) ‘yyyymmdd’ format, and expanded some unit tests.
Changes in anytime version 0.3.1 (2017-06-05)
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page.
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A new version of the anytime package is now on CRAN. It marks the eleventh release since the inaugural version late last summer.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, ... format to either POSIXct or Date objects -- and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.
This release brings a little more consistency to how numeric or integer arguments are handled. Previously, we were overly eager in accepting something such as 20150605 (i.e. today) as a (numerical or integer) input to both anytime()
and anydate()
. That is well-intentioned, but ultimately foolish. We relied on heuristic cutoffs to determine whether input was "meant to be" a date or time offset. There lies madness. We now differentiate whether we were called via anytime()
(in which case numerical data is second offset to the epoch, just as.POSICct()
) or anytime()
(in which case it is days offset to the (date) epoch, just like as.Date()
). The previous behaviour can be restored via a options, both function-local as well as global are supported. And of course, there is no change for all other (and more common) input formats, notably character
or factor
. A full list of changes follows.
Changes in anytime version 0.3.0 (2017-06-05)
Numeric input is now always an offset to epoch, with
anytime()
using seconds, andanydate()
using dates. (#65 fixing #63).Old behaviour can be re-enabled with an option also supporting a global setting
getOption("anytimeOldHeuristic")
RStudio versions 1.1.129 or later can run all functions without fear of crashing due to a change in their use of Boost.
Replaced
init.c
with registration code inside ofRcppExports.cpp
thanks to Rcpp 0.12.11.
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page.
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A bugfix release of the anytime package arrived at CRAN earlier today. This is tenth release since the inaugural version late last summer, and the second (bugfix / feature) release this year.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, ... format to either POSIXct or Date objects -- and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.
This releases addresses an annoying bug related to British TZ settings and the particular impact of a change in 1971, and generalizes input formats to accept integer or numeric format in two specific ranges. Details follow below:
Changes in anytime version 0.2.2 (2017-03-21)
Address corner case of integer-typed (large) values corresponding to
POSIXct
time (PR #57 closing ##56)Add special case for ‘Europe/London’ and 31 Oct 1971 BST change to avoid a one-hour offset error (#58 fixing #36 and #51)
Address another corner case of numeric values corresponding to
Date
types which are now returned asDate
Added file
init.c
with calls toR_registerRoutines()
and R_useDynamicSymbols()
; already used.registration=TRUE
inuseDynLib
inNAMESPACE
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page.
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
An updated anytime package arrived at CRAN yesterday. This is release number nine, and the first with a little gap to the prior release on Christmas Eve as the features are stabilizing, as is the implementation.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, ... format to either POSIXct or Date objects -- and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.
This releases addresses two small things related to the anydate()
and utcdate()
conversion (see below) and adds one nice new format, besides some internal changes detailed below:
R> library(anytime)
R> anytime("Thu Sep 01 10:11:12 CDT 2016")
[1] "2016-09-01 10:11:12 CDT"
R> anytime("Thu Sep 01 10:11:12.123456 CDT 2016") # with frac. seconds
[1] "2016-09-01 10:11:12.123456 CDT"
R>
Of course, all commands are also fully vectorised. See the anytime page, or the GitHub README.md for more examples.
Changes in anytime version 0.2.1 (2017-02-09)
The new
DatetimeVector
class from Rcpp is now used, and proper versioned Depends: have been added (#43)The
anydate
andutcdate
functions convert again from factor and ordered (#46 closing #44)A format similar to RFC 28122 but with additonal timezone text can now be parsed (#48 closing #47)
Conversion from
POSIXt
toDate
now also respect the timezone (#50 closing #49)The internal
.onLoad
functions was updatedThe Travis setup uses https to fetch the run script
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page.
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A brand new anytime package just arrived at CRAN. This is release number eight, evenly spread with over two per month, since the initial release in September. Needless to say I have been told off not to make this many releases. As they say, no good deed goes unpunished.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, ... format to either POSIXct or Date objects -- and to do so without requiring a format string. See the anytime page, or the GitHub README.md for a few examples.
This releases does a few things:
anydate()
would somehow wrap around and return the previous day by accident. This has been addressed by moving the conversion to date directly into the C++ side of things.The following is a quick illustration
R> library(anytime)
R> p <- anytime("2010-01-02 03:04:05.123456")
R> p
[1] "2010-01-02 03:04:05.123456 CST"
R> iso8601(p)
[1] "2010-01-02 03:04:05"
R> rfc2822(p)
[1] "Sat, 02 Jan 2010 03:04:05.123456 -0600"
R> rfc3339(p)
[1] "2010-01-02T03:04:05.123456-0600"
R>
For symmetry, it also works for dates, but is less detailed
R> jl <- anydate("July 04, 1789")
R> jl
[1] "1789-07-04"
R> iso8601(jl)
[1] "1789-07-04"
R> rfc2822(jl)
[1] "Sat, 04 Jul 1789"
R> rfc3339(jl)
[1] "1789-07-04"
R>
Of course, all commands are also fully vectorised. See the anytime page, or the GitHub README.md for more examples.
Changes in anytime version 0.2.0 (2016-12-24)
Added (exported) helper functions iso8601(), rfc2822() and rfc3339() to format date(time) objects according to standards
Conversion to dates is now more robust thanks to improved internal processing (PR #39 closing #36)
The ISO 8601 format is now recognised, however the timezone information is not parsed by Boost Date_Time (which is a known upstream limitation) (PR #38 closing #37)
The 'allFormats.R' test script was significantly strengthened (#40)
Test scripts like 'simpleTests.R' have as also been strengthened (#41); on Windows and in one file two tests need to be skipped.
A new 'bulkTest.R' test script was added testing parsing against what R returns
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page.
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Another update, now at release 0.1.2, of anytime arrived at CRAN earlier today.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, ... format to either POSIXct or Date objects -- and to do so without requiring a format string.
See the anytime page, or the GitHub README.md for a few examples, or just consider the following illustration:
R> library(anytime)
R> anytime("20161107 202122") ## all digits
[1] "2016-11-07 20:21:22 CST"
R> utctime("2016Nov07 202122") ## UTC parse example
[1] "2016-11-07 14:21:22 CST"
R>
Release 0.1.2 addresses a somewhat bizarre Windows-only bug reported at GitHub in #33 and at StackOverflow. Formats of the %Y-%b-%d
form, ie 2016-Dec-12
for today would fail on Windows as the contiguous string was apparently getting split by a routine looking for splits on spaces. Really strange.
Anyway, I switched to using more helper functions from the Boost String Algorithms library, and things are behaving now. An extra shoutout once more to Gábor Csárdi and the R Consortium for the most awesome R-Builder. I was able to test and fix on Windows during the weekend with no access to an actual windows environment.
The NEWS
file summarises the release:
Changes in anytime version 0.1.2 (2016-12-13)
The (internal) string processing and splitting now uses Boost algorithm functions which avoids a (bizarre) bug on Windows.
Test coverage was increased.
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page.
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
CRAN just accepted the newest release 0.1.1 of anytime, following the previous five releases since September.
anytime is a very focussed package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, ... format to POSIXct (or Date) objects -- and to do so without requiring a format string.
See the anytime page, or the GitHub README.md for a few examples, or just consider the following illustration:
R> library(anytime)
R> anytime("20161107 202122") ## all digits
[1] "2016-11-07 20:21:22 CST"
R> utctime("2016Nov07 202122") ## UTC parse example
[1] "2016-11-07 14:21:22 CST"
R>
Release 0.1.1 robustifies two aspects. The 'digits only' input above extends what Boost Date_Time can parse and relies on simple-enough pre-processing. This operation is now more robust. We also ensure that input already of class Date
is simply passed through by anydate()
or utcdate()
. Last but not least we added code coverage support, which oh-so-predictably lead us to game this metric to reach the elusive 100% coverage.
The NEWS
file summarises the release:
Changes in anytime version 0.1.1 (2016-11-27)
Both
anydate()
andutcdate()
no longer attempt to convert an input value that is already of typeDate
.The string splitter (needed for the 'all-digits' formats extending Boost Date_time) is now more defensive about the input argument and more robust. Thanks to Bob Jansen for the heads-up (PR #30 closing issue #29).
Code coverage reporting has been added (PR #31).
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page.
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A new release of anytime is now on CRAN following the four releases in September and October.
anytime aims to convert anything in integer, numeric, character, factor, ordered, ... format to POSIXct (or Date) objects -- and does so without requiring a format string. See the anytime page for a few examples.
Release 0.1.0 adds several new features. New functions utctime()
and utcdate()
parse to coordinated universal time (UTC). Several new formats were added. Digit-only formats like 'YYYYMMDD' with or without 'HHMMSS' (or even with fractional secodns 'HHMMSS.ffffff') are supported more thoroughly. Some examples:
R> library(anytime)
R> anytime("20161107 202122") ## all digits
[1] "2016-11-07 20:21:22 CST"
R> utctime("2016Nov07 202122") ## UTC parse example
[1] "2016-11-07 14:21:22 CST"
R>
The NEWS
file summarises the release:
Changes in anytime version 0.1.0 (2016-11-06)
New functions
utctime()
andutcdate()
were added to parse input as coordinated universal time; the functionality is also available inanytime()
andanydate()
via a new argumentasUTC
(PR #22)New (date)time format for RFC822-alike dates, and expanded existing datetime formats to all support fractional seconds (PR #21)
Extended functionality to support not only ‘YYYYMMDD’ (without a separator, and not covered by Boost) but also with ‘HHMM’, ‘HHMMSS’ and ‘HHMMSS.ffffff’ (PR #30 fixing issue #29)
Extended functionality to support ‘HHMMSS[.ffffff]’ following other date formats.
Documentation and tests have been expanded; typos corrected
New (unexported) helper functions
setTZ
,testOutput
,setDebug
The
testFormat
(andtestOutput
) functions cannot be called under RStudio (PR #27 fixing issue #25).More robust support for non-finite values such as
NA
,NaN
orInf
(Fixing issue #16)
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page.
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
A brand-new release of anytime is now on CRAN following the three earlier releases since mid-September. anytime aims to convert anything in integer, numeric, character, factor, ordered, ... format to POSIXct (or Date) objects -- and does so without requiring a format string. See the anytime page for a few examples.
With release 0.0.4, we add two nice new features. First, NA
, NaN
and Inf
are now simply skipped (similar to what the corresponding Base R functions do). Second, we now also accept large numeric values so that, _e.g., anytime(as.numeric(Sys.time())
also works, effectively adding another input type. We also have squashed an issue reported by the 'undefined behaviour' sanitizer, and the widened the test for when we try to deploy the gettz package get missing timezone information.
A quick example of the new features:
anydate(c(NA, NaN, Inf, as.numeric(as.POSIXct("2016-09-01 10:11:12"))))
[1] NA NA NA "2016-09-01"
The NEWS
file summarises the release:
Changes in anytime version 0.0.4 (2016-10-20)
Before converting via
lexical_cast
, assign to atomic type via template logic to avoid an UBSAN issue (PR #15 closing issue #14)More robust initialization and timezone information gathering.
More robust processing of non-finite input also coping with non-finite values such as
NA
,NaN
andInf
which all returnNA
Allow numeric
POSIXt
representation on input, also creating properPOSIXct
(or, if requested,Date
)
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page.
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
anytime arrived on CRAN with releases 0.0.1 and 0.0.2 about a month ago. anytime aims to convert anything in integer, numeric, character, factor, ordered, ... format to POSIXct (or Date) objects.
Release 0.0.3 brings a bugfix for Windows (where for dates before the epoch of 1970-01-01, accessing the tm_isdst
field for daylight savings would crash the session) and a small (unexported) extension to test format strings. This last feature plays well the ability to add format strings which we added in 0.0.2.
The NEWS
file summarises the release:
Changes in Rcpp version 0.0.3 (2016-10-13)
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page.
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
anytime arrived on CRAN via release 0.0.1 a good two days ago. anytime aims to convert anything in integer, numeric, character, factor, ordered, ... format to POSIXct (or Date) objects.
This new release 0.0.2 adds two new functions to gather conversion formats -- and set new ones. It also fixed a minor build bug, and robustifies a conversion which was seen to be not quite right under some time zones.
The NEWS
file summarises the release:
Changes in Rcpp version 0.0.2 (2016-09-15)
Refactored to use a simple class wrapped around two vector with (string) formats and locales; this allow for adding formats; also adds accessor for formats (#4, closes #1 and #3).
New function
addFormats()
andgetFormats()
.Relaxed one tests which showed problems on some platforms.
Added
as.POSIXlt()
step toanydate()
ensuring allPOSIXlt
components are set (#6 fixing #5).
Courtesy of CRANberries, there is a comparison to the previous release. More information is on the anytime page.
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
anytime just arrived on CRAN as a very first release 0.0.1.
So why (yet another) package dealing with dates and times? R excels at computing with dates, and times. By using typed representation we not only get all that functionality but also of the added safety stemming from proper representation.
But there is a small nuisance cost: How often have we each told as.POSIXct()
that the origin is epoch '1970-01-01'? Do we have to say it a million more times? Similarly, when parsing dates that are in some recogniseable form of the YYYYMMDD format, do we really have to manually convert from integer
or numeric
or factor
or ordered
to character first? Having one of several common separators and/or date / time month forms (YYYY-MM-DD, YYYY/MM/DD, YYYYMMDD, YYYY-mon-DD and so on, with or without times, with or without textual months and so on), do we really need a format string?
anytime()
aims to help as a small general purpose converter returning a proper POSIXct
(or Date
) object nomatter the input (provided it was somewhat parseable), relying on Boost date_time for the (efficient, performant) conversion.
See some examples on the anytime page or the GitHub README.md, or in the screenshot below. And then just give it try!
For questions or comments use the issue tracker off the GitHub repo.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.