Re: [Pharo-users] DateTime now nanos

2020-06-15 Thread Pierce Ng
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

Re: [Pharo-users] DateTime now nanos

2020-06-15 Thread Jeff Gray
Wow thanks all. Interesting topic. I think the short answer I can glean here is use a string. I wasn't sure as the SQLite doco suggested either string or number and number felt the right thing to choose. Clearly not :-) -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Re: [Pharo-users] DateTime now nanos

2020-06-15 Thread Richard O'Keefe
Comparing floating-point numbers is perfectly well defined. Floating point NUMBERS are precise. Floating point OPERATIONS are approximate. (See for example the LIA-1 standard.) In the same way, comparing timestamps *from the same source* is perfectly well defined. Considering that light travels 30

Re: [Pharo-users] DateTime now nanos

2020-06-15 Thread Sven Van Caekenberghe
Hi Jeff, > On 15 Jun 2020, at 09:08, Jeff Gray wrote: > > Thanks Steph. > > Running a similar experiment using ZTimestamp: > > |ts1 ts2| > ts1 := ZTimestamp now. > tsNumber := ts1 asUnixTime. > ts2 := ZTimestamp fromUnixTime: tsNumber. > Transcript cr; show: ts1. > Transcript cr; show: ts2. >

Re: [Pharo-users] DateTime now nanos

2020-06-15 Thread Jeff Gray
Thanks Steph. Running a similar experiment using ZTimestamp: |ts1 ts2| ts1 := ZTimestamp now. tsNumber := ts1 asUnixTime. ts2 := ZTimestamp fromUnixTime: tsNumber. Transcript cr; show: ts1. Transcript cr; show: ts2. I get the output: 2020-06-15T07:05:59Z 2020-06-15T07:05:59Z -- Sent from: ht