When SQLite is inserted, 0:00:00 appears.

Source: Internet
Author: User
Tags iso 8601 sqlite database

Converts a type when the date is saved to the SQLite database, for example, string _ now = system. datetime. Now. tostring ("S ");

That is to say, adding an s in the. tostring () method and converting it to the ISO 8601 standard string format can solve the problem of date reading errors.

In addition, it is very troublesome to convert the data in this way every time. In particular, we do not operate the datetime column to make it null (null is considered as "1899-12-30 0:00:00 "), when creating a table, we can set this column as non-empty and the initial value: 1899-12-30t0: 00: 00. In this way, we can also recognize the default values of SQLite when we do not operate this column.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.