Skip to content

Instantly share code, notes, and snippets.

@yyamasak
Last active December 14, 2016 02:45
Show Gist options
  • Save yyamasak/4e7c2f001ae9d7e38a3bfea7a9329dbe to your computer and use it in GitHub Desktop.
Save yyamasak/4e7c2f001ae9d7e38a3bfea7a9329dbe to your computer and use it in GitHub Desktop.
Tcl + sqlite3 script to parse an ISO8601 datetime string
package require sqlite3
sqlite3 mdb :memory:
set dt "2016-12-13T18:54:21.182556"
set unixepoch [mdb eval {SELECT strftime('%s',$dt,'UTC')}]
puts $unixepoch
#=> 1481622861
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment