Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8694305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:45:19+00:00 2026-06-13T00:45:19+00:00

I have an application that use sqlite as local database, but I have problems

  • 0

I have an application that use sqlite as local database, but I have problems with the format of the dates.

I am using System.Data.Sqlite as database provider and I create my edmx, that is created from the sqlite database.

When I make a query to the database, in my entity class that has some date field, I can see that the dateTime property has the correct format, in my case, dd mm yyyy and 18:00 (the hour is of 24 hours, not 12pm for example).

However, when I do the binding (I am using WPF and MVVM) to the dataGrid, in the columns of date the format of the date is mm dd yyyy 12pm (the hour is not of 24).

Why?, if I receive the data in the correct format, because the entity object has de date in the correct format I see the information in other format in the dataGrid? When I use SQL Server as dataBase, I don’t have this problem, the format is correct in the dataGrid.

My windows is configurated to ES (Spain).

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:45:20+00:00Added an answer on June 13, 2026 at 12:45 am

    I would guess that the problem is with the DateTime.Kind property. Dates can be Local, UTC, or unknown. Check that the date is restoring from the database with the same Kind-ness, and if not, adjust your Sqlite connection parameters to use the Kind you wish to work with.

    The proper way to handle this, in my opinion, is to always store dates/times as UTC in the database and always query against the database using equivalent UTC representation. You can set the DateTime kind to UTC in the Sqlite connection settings. You can ensure that your objects have local times in your property setter if you want the objects to always represent times that way, like so:

    public DateTime YourDateTimeProperty
    {
        get { return _dateTime; }
        set { _dateTime = value.ToLocalTime(); }
    }
    

    Which should ensure that times stay local after being loaded from the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a django application that uses an SQLite database. I use git to
I have a Web Application that use Hibernate 3.0. When I restart my database
I have an C# form application that use an access database. This application works
I have just learned how to use the SQLite database for local storage in
I already have an application that uses the SQLite database and a listadapter. I
I have an application that uses SQLite(version 3.7.2) to store data. I have a
I am developing a PHP application that uses SQLite as database management system, MySQL
I'm using core data on an iPhone application. I have multiple persisntent stores that
Working on an application that has very heavy use of the local sqlite db.
I've a winforms application that is using SQLite database. There is no encryption on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.