Request for Elements RTL/DateTime

(Alan Olson) #1

Could someone add the following methods to the Elements.RTL.DateTime class?

ToOADate(ADateTime: DateTime): Double;
DateTime.FromOADate(AOADate: Double): DateTime;


(marc hoffman) #2

That seems to be pretty Windows-platform specific? Wouldn’t it be ok to simply access the inner native System.DateTime for this?

(Alan Olson) #3

The reason for the request is this. We have built a database that stores dates as doubles (OADates) extensively. From .NET thus isn’t an issue. From DA / Cocoa it now is. I could write my own routine but thought elements RTL would be a good place for it.

(marc hoffman) #4

Gotcha, yes, i can see how it would be helpful. is OADate the same format Delphi uses (which i know is double based), do you know? if so, we might already have this in Delphi RTL, and i coukld migrate it down. If not, do you have an algorithm handy i can reuse (either raw, or as a finished pull request for Elements RTL)?

(Alan Olson) #5

Yes exactly the same as Delphi. That is probably why the db was designed this way due to Delphi’s date storage since at the time all was being written in Delphi. I don’t have any code currently but if you have something in the Delphi RTL we should be good!


(marc hoffman) #6

thanx. will have a look tomorrow.

(Alan Olson) #7

Is there any update on this by chance?

(marc hoffman) #8

Not yet, sorry. weekends, holidays, docs writing and stuff got in the way :wink:

(RemObjects) #9

Thanks, logged as bugs://79317

(RemObjects) #10

bugs://79317 got closed with status fixed.

(Alan Olson) #11

Thanks! Where was this added?

(marc hoffman) #12

It’s in there GitHub repo (, and should be in next Friday’s beta.