[Tarantool-patches] [PATCH v5 2/8] lua: built-in module datetime

Vladimir Davydov vdavydov at tarantool.org
Tue Aug 17 22:16:33 MSK 2021


On Tue, Aug 17, 2021 at 07:52:43PM +0300, Vladimir Davydov wrote:
> On Mon, Aug 16, 2021 at 02:59:36AM +0300, Timur Safin via Tarantool-patches wrote:
> > +/**
> > + * Full datetime structure representing moments
> > + * since Unix Epoch (1970-01-01).
> > + * Time is kept normalized to UTC, time-zone offset
> > + * is informative only.
> > + */
> > +struct datetime {
> > +	/** seconds since epoch */
> > +	double secs;
> 
> Please add a comment explaining why you use 'double' instead of
> an integer type.

Come to think of it, why don't you use two ints here? E.g. one for low
32 bits, another for high 32 bits, or one for years, another for seconds
in the year.


More information about the Tarantool-patches mailing list