Reposting to the ML, maybe I'll have more luck there, than in the forum?
--DD

---------- Forwarded message ---------
From: ddevienne <noreply9ec79e...@sqlite.org>
Date: Tue, Mar 17, 2020 at 5:09 PM
Subject: [sqlite-forum] Convert datetime string to second since Epoch with
millisecond precision
To: <ddevie...@gmail.com>


Forum post by ddevienne on 2020-03-17 16:09:17
https://sqlite.org/forum/forumpost/0d9c338ff1

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>
```
-- 
Subscription info:
https://sqlite.org/forum/alerts/54F6DD420B31FA7F9F69F5498F1631F5E6D4B48CF97539FDEEF90F71733E90A9
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to