Skip to content

Runtime Data Representation

Jack Feser edited this page Jan 7, 2019 · 1 revision

Dates

Castor represents dates as the number of days since the UNIX epoch.

In implang.ml, dates and integers share many operations (since dates are represented as integers at runtime). However, not all operations that are valid for integers are valid for dates. For example, dates can be subtracted from each other (producing the offset between them) but not added.

Known issues

  • year(x) = 365 * x, month(x) = 30 * x and day(x) = x. Other dbs have more sophisticated date math.
Clone this wiki locally