Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

Say I have a date object date = DateObject[{2016, 7, 17, 0, 0}], how do I later change the hour of that date object, without needing to know the value it currently has?

I'm searching for something like date /. Hour -> 18, but can't find it in the documentation, just that

DateObject allows addition and subtraction of time quantities.

[Edit] How to modify wrong time zone in a Date object?How to modify wrong time zone in a Date object? is related, but I already tried date /. (Hour -> _) :> (Hour -> 18) and that didn't work.

Say I have a date object date = DateObject[{2016, 7, 17, 0, 0}], how do I later change the hour of that date object, without needing to know the value it currently has?

I'm searching for something like date /. Hour -> 18, but can't find it in the documentation, just that

DateObject allows addition and subtraction of time quantities.

[Edit] How to modify wrong time zone in a Date object? is related, but I already tried date /. (Hour -> _) :> (Hour -> 18) and that didn't work.

Say I have a date object date = DateObject[{2016, 7, 17, 0, 0}], how do I later change the hour of that date object, without needing to know the value it currently has?

I'm searching for something like date /. Hour -> 18, but can't find it in the documentation, just that

DateObject allows addition and subtraction of time quantities.

[Edit] How to modify wrong time zone in a Date object? is related, but I already tried date /. (Hour -> _) :> (Hour -> 18) and that didn't work.

Tweeted twitter.com/StackMma/status/754873766031790080
see comment
Source Link

Say I have a date object date = DateObject[{2016, 7, 17, 0, 0}], how do I later change the hour of that date object, without needing to know the value it currently has?

I'm searching for something like date /. Hour -> 18, but can't find it in the documentation, just that

DateObject allows addition and subtraction of time quantities.

[Edit] How to modify wrong time zone in a Date object? is related, but I already tried date /. (Hour -> _) :> (Hour -> 18) and that didn't work.

Say I have a date object date = DateObject[{2016, 7, 17, 0, 0}], how do I later change the hour of that date object, without needing to know the value it currently has?

I'm searching for something like date /. Hour -> 18, but can't find it in the documentation, just that

DateObject allows addition and subtraction of time quantities.

Say I have a date object date = DateObject[{2016, 7, 17, 0, 0}], how do I later change the hour of that date object, without needing to know the value it currently has?

I'm searching for something like date /. Hour -> 18, but can't find it in the documentation, just that

DateObject allows addition and subtraction of time quantities.

[Edit] How to modify wrong time zone in a Date object? is related, but I already tried date /. (Hour -> _) :> (Hour -> 18) and that didn't work.

Source Link

Set hour of DateObject

Say I have a date object date = DateObject[{2016, 7, 17, 0, 0}], how do I later change the hour of that date object, without needing to know the value it currently has?

I'm searching for something like date /. Hour -> 18, but can't find it in the documentation, just that

DateObject allows addition and subtraction of time quantities.