SQLite datetime - "String '' was not recognized as a valid DateTime." #123
Closed
SubScrubber
started this conversation in
General
Replies: 1 comment
-
@SubScrubber -- Thanks, glad you like it. Version 2.0 added the Open-SQLiteConnection $DBFilePath -Additional @{DateTimeFormat="Ticks"} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This had me stumped for a bit, so I figured I'd share.
Similar fixes for MySQL in the issues section.
This is for SQLite
Adding the following to connection string resolves the error:
DateTimeFormat=Ticks;
e.g.
$SQLiteConnSting = "Data Source=$DBFilePath;Version=3;DateTimeFormat=Ticks;"
This changes UnixEpoch dates to dates but shows dates as '00-00-0000', with only the time seeming correct.
Selecting the dates with the following query gave the correct dates:
$Query = @' SELECT datetime(StartTime,'unixepoch') as "StartTime", datetime(EndTime,'unixepoch') as "EndTime", FROM table '@
Not a SimplySql problem, more a SQLite datetime quirk
Thanks for the Mod! Great work!
Beta Was this translation helpful? Give feedback.
All reactions