Question about SQLite database's valid_upto field

Prasun Kumar prasun.code at gmail.com
Wed Jun 10 02:37:19 BST 2020


>
> I spotted a few trailing blanks. Maybe, you can teach your editor to
>
> automatically remove those when saving.
>

Thanks. Removed them and configured my editor too.

Is there a specific reason why you convert the date into a numeric value
> (julianday())
>
> and don't use the SQLite date type?
>

SQLite does not have a DATE type.
>From https://www.sqlite.org/datatype3.html :

> SQLite does not have a storage class set aside for storing dates and/or
> times. Instead, the built-in Date And Time Functions
> <https://www.sqlite.org/lang_datefunc.html> of SQLite are capable of
> storing dates and times as TEXT, REAL, or INTEGER values:
>
>    - *TEXT* as ISO8601 strings ("YYYY-MM-DD HH:MM:SS.SSS").
>    - *REAL* as Julian day numbers, the number of days since noon in
>    Greenwich on November 24, 4714 B.C. according to the proleptic Gregorian
>    calendar.
>    - *INTEGER* as Unix Time, the number of seconds since 1970-01-01
>    00:00:00 UTC.
>
> Applications can chose to store dates and times in any of these formats
> and freely convert between formats using the built-in date and time
> functions <https://www.sqlite.org/lang_datefunc.html>.
>
Since I have to compare the validity date with the current date while
reading data in the library code, so I thought TEXT was not a good idea. I
looked online and saw REAL being used more often than INTEGER. So chose
REAL.

Thanks.
Prasun

On Wed, 10 Jun 2020 at 01:03, Thomas Baumgart <thb at net-bembel.de> wrote:

> Prasun,
>
>
>
> On Montag, 8. Juni 2020 20:01:09 CEST Prasun Kumar wrote:
>
>
>
> > Yeah, forgot about that. Thanks for reminding.
>
> >
>
> > BTW did you have a look at the commits I made? I have made some changes
> to
>
> > the CMake build system and frankly I have not had much previous
> experience
>
> > with CMake. Can you verify that I have not added anything that could
> cause
>
> > problems in the future?
>
>
>
> I am not a CMake expert myself but things look OK to me.
>
>
>
> I spotted a few trailing blanks. Maybe, you can teach your editor to
>
> automatically remove those when saving. See this screenshot:
>
>
>
>
>
> Is there a specific reason why you convert the date into a numeric value
> (julianday())
>
> and don't use the SQLite date type?
>
>
>
> Thomas
>
>
>
> --
>
>
>
> Regards
>
>
>
> Thomas Baumgart
>
>
>
> https://www.signal.org/ Signal, the better WhatsApp
>
> -------------------------------------------------------------
>
> Flying is absolutely safe as long as you land as often
>
> as you take off. -- Klaus Klages
>
> -------------------------------------------------------------
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-finance-apps/attachments/20200610/800c8f18/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image
Type: image/png
Size: 41506 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-finance-apps/attachments/20200610/800c8f18/attachment-0001.png>


More information about the Kde-finance-apps mailing list