Skip to content

DateTime Storage, why Ticks? #203

@Schlumpf9

Description

@Schlumpf9

I saw that DateTime is stored as bigint in SQLite. Why it isn't stored in Datetime Format 2012-08-28 08:35:33 or as Unix Timestamp?

When I use DateTime.Now in C# I have this number stored: 635742203345490322. How can I work with that number in a SQLite Select?!
SELECT strftime("%d.%m.%Y",635742203345490322); results in 06.10.-471 ...

I googled and found this:
SELECT strftime('%Y-%m-%d %H:%M:%S', 635742203345490322 / 10000000 - 62135596800, 'unixepoch','localtime')
which returns 2015-08-03 19:38:54 as it should. But this solution is in my eyes shit... Any other solutions? Would be great if a timestamp or something can be stored...

Greets

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions