Date.Seconds vs. DateTime.Seconds

What is the reason that Date.Seconds can be set and DateTime.Seconds can not be set?

For the seconds (or hours, etc.) to be changed, at the moment the only solution is to create a new DateTime, correct?

thanks a lot in advance, regards!

Ok, found AddInterval; a somewhat “solution” to the problem.

The best way to handle this is to abstract away this in an own class.
Maybe always a good idea…

I think, as date time arithmetic is not simply adding, it’s better to create new object from DateTime for every change(?)

Since you are a pre-release tester, filter the forum channel to pre-release 2019r2 and search for “Date.TotalSeconds”. The top hit should be a thread with 126 messages discussing the topic.

I’d link to it, but didn’t know if that would provide access to those not in the pre-release group.

Short answer: API 2.0 considers the new DateTime class immutable – i.e., unchangeable.

Thanks a lot for the answer!

At the forum, I can not use pre-release channel; I am not even verified.

I think it’s legal to decide so.

I decided to lift up Aloe Express to new API and meanwhile also start learning Perl 5;-)

DateTime is not as easy to work with as Date, but it is also not as easy to get wrong. Have a look at https://blog.xojo.com/2019/10/14/lets-talk-datetime/ to see how easy it can be to use.

Great! Clarified using of TimeZone!
Thanks a lot!

Changed all dates in Aloe Express… Now I am at ChrB…

The fun never ends;-)

I’d be interested to know what your solution was.