The time in SQLite

Source: Internet
Author: User
Tags sqlite

SQL statement for Insert time

Insert  into[DataTable]([Collectdatetime],[Channel_1],[channel_2],[Channel_3],[Channel_4],[channel_5],[Channel_6],[channel_7],[Channel_8],[Channel_9],[channel_10],[Channel_11],[Channel_12],[channel_13],[channel_14],[channel_15],[channel_16],[channel_17],[channel_18],[channel_19],[channel_20],[channel_21],[channel_22],[channel_23],[channel_24],[channel_25],[channel_26],[channel_27],[channel_28],[channel_29],[channel_30],[channel_31],[channel_32],[channel_33],[channel_34],[channel_35],[channel_36],[channel_37],[channel_38],[channel_39],[channel_40],[channel_41],[channel_42],[channel_43],[channel_44],[channel_45],[channel_46],[channel_47],[channel_48],[channel_49],[channel_50],[channel_51],[channel_52],[channel_53],[channel_54],[channel_55],[channel_56],[channel_57],[channel_58],[channel_59],[channel_60])Values('2014-11-17t19:37:32','-152','-416','-170','-128','-154','-110','-122',' -','-227','-90','-80','-98','-18','-29',' -','-29','-71','-50','-76','-128','6','192',' the',' $',' +',' -','118',' +',' the',' -',' -','-112','-7','-133','-71','-23','-79','-127','-6','-119','232','-101','-146','-309','-127','-212','-181','-152','-62','-68','161',' the',' +',' the','104',' at','288',' +','287','-61')

Time format ' 2014-11-17t19:37:32 '

Month day and hour and seconds between a letter T, when saved to the database, will automatically give time to add 8 hours. The saved result is 2014-11-18 03:37:32

Time format ' 2014-11-17 19:37:32 ' when saving to the database, save directly. The saved result is 2014-11-17 19:37:32

Use this statement to read data from the data

Sqliteconnectionstringbuilder s = new Sqliteconnectionstringbuilder ();
S.datasource = Dbname;//dbname is the path that contains the database file name
S.datetimekind = datetimekind.local;
ConnectString = S.tostring ();

The data stored above, read out, all is 2014-11-17 19:37:32

However, the time to filter the condition must be more than 2014-11-18 03:37:32, otherwise, the filter will not be ' 2014-11-17t19:37:32 '

If you comment out the above statement s. DateTimeKind = datetimekind.local;

When querying, it is also the same effect, the time to filter the condition must be more than 2014-11-18 03:37:32, otherwise it will not be able to filter out the time required

If the S. DateTimeKind set to S.datetimekind = DATETIMEKIND.UTC;

Filter time, still need to follow more than 2014-11-18 03:37:32 to filter, read the time display or 2014-11-17 19:37:32

Depressed, completely do not know the meaning of setting datetimekind

Need to find a time to write a demo to study

The time in SQLite

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.