Comments (7)
to self: % doesn't seem to work, but # does
from lubridate.
also check if there is a time string on the end (which would screw up the # method)
from lubridate.
maybe guess_format could spot time strings and select the correct year format by counting the number of characters in the date object?
from lubridate.
guess_format() has been updated. If a user asks for ymd(x) when x also includes a time string, guess_format() will say that all failed to parse and prompt the user to look for missing or incorrect format elements.
Is this sufficient?
Do you want another function that will make a best determination of any possible format if the user has no clue?
from lubridate.
That sounds ok to me.
from lubridate.
Did you want me to make a helper function like ymdhms() for dates with time strings? I'm not sure what we decided at the last meeting (I didn't write it down or see it hear in the issues) :P
It would be difficult to test all the permutations of separators involved, but perhaps we could simplify it by using find_separators() to shorten the list. Or we could allow users to only use time stamps that end with 00:00:00, which seems usual (although sometimes seconds may have decimals). We could then shunt the last 8 characters into strptime and use ymd() on whatever is left over at the beginning.
Or as long as it has separators and is just numbers, we could
- use find_separators() to identify separators
- use strsplit to divide the datetime into its parts
- use a slightly improved new_duration() to turn the datetime into a duration
- add that duration to 0 AD to have a date and a time in POSIXt format.
- we might have to make some adjustments for leap seconds, but the leap years will take care of themselves. I don't know about daylight savings
Should I work on this?
Should we have a function that would simply separate the date and time components of a date time?
from lubridate.
ps. I like the review tab idea
from lubridate.
Related Issues (20)
- `parse_date_time()` cannot match missing zeroes
- Inconsistent behavior of `parse_date_time()` inside `dplyr::mutate()` HOT 2
- month() and otehrs fail on objects from class 'timeDate'
- ymd_hms() function left-pads some dates that have missing "seconds" values
- round_date in 0.1 sec doesn't work correctly
- FR: int_overlaps with exclusive endpoints
- unique() always zero for periods HOT 1
- Implement Set Operations methods for Dates HOT 1
- Parsing dates with `my` seems to have a limit size
- Do we need something like `%m-%` to subtract years from leap 02/29? HOT 1
- Cannot compute `<date> + lubridate::year(1)` when `<date>` is a leap day. HOT 1
- m:s:ms time data
- `dmy()` not failing (and returning incorrect date) on wrong date format
- ceiling_date() issue when using multi units
- Fractional Seconds with conversion and rounding/truncation?
- mdy("04 July 2019") GIVES "2019-04-20" : Instead should give an error.
- data.table merge doesn't work with intervals HOT 1
- yearmonth() throws an error with C_force_tz
- Feature request: Excel date origin
- how about adding lubridate hex log to tidyverse main page? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lubridate.