delorean icon indicating copy to clipboard operation
delorean copied to clipboard

Feature Request: Adding a `replace` method to replace parts on the underlying `datetime` object

Open masnun opened this issue 9 years ago • 1 comments

I was wondering if we could have a feature where we could replace the parts of the underlying datetime object. For example, I would really love to do this:

d = Delorean(timezone="US/Eastern")
d = d.replace(hour=8, minute=10)

I am currently achieving this by doing this:

d = Delorean(timezone="US/Eastern")
dt = d.datetime.replace(hour=12)
d = Delorean(dt)

But the above would be much easier. I can send a PR if this seems like a good idea.

masnun avatar Mar 10 '16 12:03 masnun

yeah if you wouldn't mind providing PR and test I would definitely be interested in merging this in.

myusuf3 avatar Mar 11 '16 16:03 myusuf3