Login  Register

Re: DateTime now nanos

Posted by Pierce Ng-3 on Jun 16, 2020; 1:24am
URL: https://forum.world.st/DateTime-now-nanos-tp5118503p5118565.html

On Mon, Jun 15, 2020 at 01:23:06AM -0500, Jeff Gray wrote:
> Maybe I should just be asking what people normally do to store dates in
> SQLite. (I'm guessing there aren't that many...)

The Pharo SQLite binding stores DateAndTime instances as strings. When
fetching from the database, if the declared column type looks
date/time-ish then that string is turned back into a DateAndTime
instance.

See this blog post:

  https://www.samadhiweb.com/blog/2015.04.09.nbsqlite3.datetime.html

The blog post refers to NBSQLite3Connection, which is for the Pharo 4
NativeBoost FFI version.

Current version is here:

  https://github.com/pharo-rdbsm/Pharo-SQLite3

I've entertained the idea of making it pluggable, so that the
application programmer gets to decide whether to store/fetch Unix epoch
integers, Julian day floats, etc. No action, daydreaming only.

Pierce