Replies: 5 comments
-
|
Makes sense. I've see |
Beta Was this translation helpful? Give feedback.
-
|
I'd love to see something like that because this a frequently used pattern throughout my code: SystemDateTime.now().replace_time(Time(0, 0, 0), disambiguate="raise")If it also could aslo be extended to |
Beta Was this translation helpful? Give feedback.
-
|
@spacemanspiff2007 for your use case |
Beta Was this translation helpful? Give feedback.
-
|
A thought that just ocurred to me: This would make an excellent addition to a "cookbook" of sorts in the docs... |
Beta Was this translation helpful? Give feedback.
-
|
Worth noting here: there's an example entry now demonstrating getting the "start of the hour": https://whenever.readthedocs.io/en/latest/examples.html#determine-the-start-of-the-hour |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
One feature that I would find useful built into the library is something akin to Pendulum's
.start_of()method. https://pendulum.eustace.io/docs/#modifiers Given a certain DateTime, this would return a new DateTime at the start of some interval the original occurs in.Time objects could probably implement
.start_of()for second, minute, hour, and day, and Date objects could implement.start_of()for week, month, and year.Beta Was this translation helpful? Give feedback.
All reactions