Comments (10)
It might better to have a separate function for this which takes an explicit tz — this is useful when you have a vector of datetimes in UTC and a vector of local time zones and want to get the local time of day.
from hms.
I feel this is out of scope for this package. Isn't there an equivalent lubridate function?
from hms.
It feels like this is going to be a common way to create hms objects - it's often useful to partition a date-time into a date and a time. That feels very much in scope for hms (and I don't think there's an existing lubridate function for this)
from hms.
I have found x - lubridate::floor_date(x, "days")
, and lubridate::with_tz()
. Happy to implement lubridate::time_of_day()
(which should return a Duration
) and as.hms()
methods in lubridate
.
You described a common way to create time-of-day objects, but if you're dealing with timestamps, using lubridate seems a good idea anyway. I'd like to restrict the scope of hms, so unless there's a compelling reason to extend this package to handle dates, I'd prefer implementing ths in lubridate. Are we going to integrate lubridate in the tidyverse, or will there be a modern successor?
from hms.
as.hms.POSIXt()
now has a tz
argument, default UTC.
from hms.
It should default to the tz
in x
?
from hms.
Perhaps yes, but that would break compatibility. If this is important, I'd add a pkgconfig switch.
from hms.
I think it's probably fine to break compatibility given the number of uses, and the likelihood that anyone actually wants the local time in UTC.
from hms.
Agreed. The new default is now the local tz. I'd like to promote "pkgconfig" usage even if few will use it here.
from hms.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
from hms.
Related Issues (20)
- Move `master` branch to `main` HOT 3
- parse_hms() fails to parse when the duration is longer than one day
- Can hms objects be comapred with strings? HOT 1
- Loading tidyverse doesn't load hms package. HOT 2
- Parse without seconds
- Inconsistency between tibble and vector formatting if "hours" component is zero HOT 1
- Tools for decomposing a datetime into date + hms + timezone and back HOT 1
- bug detected in an Rmd, If the filter (from dplyr) generates 0 lines with one column typed hms
- Support `seq` for hms values
- Floor/Ceiling HMS
- `/` et al. drop class "hms" HOT 4
- Add digits argument to round_hms() and trunc_hms() HOT 2
- Implement comparaison with character and -/+ HOT 3
- Make as_hms() generic HOT 1
- Infloop with dev vctrs HOT 1
- Difficult to understand error message for a input of a double with attributes HOT 2
- vec_math() and vec_arith() for hms HOT 4
- Re-license as MIT HOT 4
- `unique()` returns an object of class numeric HOT 2
- cut() method for `hms` class
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 hms.