SQLite Forum

Convert datetime string to second since Epoch with millisecond precision
Login
Hi. Below does what I want, but surely there's a better way than parsing the datetime 3 times? Because the below is ugly as hell. Thanks, --DD

```
C:\Users\ddevienne>sqlite3
SQLite version 3.28.0 2019-04-16 19:49:53
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> select
   ...>        cast(strftime('%s', '2016-06-13T09:36:34.123Z') as real) +
   ...>             strftime('%f', '2016-06-13T09:36:34.123Z') -
   ...>        cast(strftime('%S', '2016-06-13T09:36:34.123Z') as real)
   ...> ;
1465810594.123
sqlite>
```