You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One field in the database I'm investigating is described as:
dateTime INTEGER NOT NULL UNIQUE PRIMARY KEY,
It's actually, as the name implies, a Unix time field containing seconds since the epoch. If there any way to display it properly in the browser?
There is no way to convert an integer into a date string built into SQLIteBrowser. This is mainly because there is no way for us to tell whether a value is to be converted or not. It's made even worse by SQLite allowing all sorts of data types to be mixed even in the same column (i.e. the same column may contain an integer for one row and e.g. a string for the next row, so these column-depending actions require us to do a lot of data checks).
What you can do though - and what I do for one database I have with epoch dates - is using the native 'datetime()' SQLite function by executing this in the Execute SQL tab of SQLiteBrowser:
SELECT*,datetime(date_column, 'unixepoch') AS date_column_string FROM table_name;
You could also create a view of this by clicking the button next to the result view and then on "Save as view".
For more details and examples on this you may want to check https://www.sqlite.org/lang_datefunc.html
I hope this helps you a bit!
Activity
MKleusberg commentedon May 30, 2014
There is no way to convert an integer into a date string built into SQLIteBrowser. This is mainly because there is no way for us to tell whether a value is to be converted or not. It's made even worse by SQLite allowing all sorts of data types to be mixed even in the same column (i.e. the same column may contain an integer for one row and e.g. a string for the next row, so these column-depending actions require us to do a lot of data checks).
What you can do though - and what I do for one database I have with epoch dates - is using the native 'datetime()' SQLite function by executing this in the Execute SQL tab of SQLiteBrowser:
You could also create a view of this by clicking the button next to the result view and then on "Save as view".
For more details and examples on this you may want to check https://www.sqlite.org/lang_datefunc.html
I hope this helps you a bit!