It appears you can pass a date var to a datetime?

So I just tested this, I have a function that takes a datetime and sent it a date and it worked?

Is this intentional? I was expecting an Expecting Datetime but got a Date error?

DateTime auto-converts to Date and vice-versa.

Thanks, I expect that will only be till they fully Deprecate Date

As I don’t expect Date (or any API1 stuff) to ever go away, sure.

So is converting to DateTime just a waste of time, I have over a 1000.

I can’t say that, but I can tell you that I haven’t bothered.

Well you don’t know that it won’t go away. Plus you’ll get completion with DateTime that you won’t get with Date.


Plus you’ll get completion

I think he’s talking about auto-completion in the editor.

Yuss. Plus you get SecondsSince1970, although I suppose TotalSeconds is nearly as good.

All dates that I get, I convert to SecondsSince1970. That way, comparison etc is trivial. And that’s what I store in my databases, leaving presentation of the date until the user asks for it, and then in the form the user expects.

That leaves me with FolderItem, have you converted them?

Nope. As a rule, I’m not converting anything unless/until I have to, or there is some great advantage.

New projects is something else, I’ll use the API2 stuff there.

1 Like

Is there any way to tell the compiler to skip some of the decremented warnings? Like Don’t show Date Decrement errors? Like when doing analyze project.

Just generally, you can turn off warnings under Project->Analysis Warnings. “Item1 is deprecated, you should use Item2 instead.”

I agree with this in general. My app (jazz discography) is very date sensitive and I’ve found it very advantageous to take the time to convert Date to DateTime. It took a while to get my head around everything, but the new DateTime is, as advertised, less error prone and easier to use.