Convert string to timestamp in MonetDB -


how 1 convert string/varchar timestamp in monetdb ?

like this, millisecond precision (to 6 decimal places, ideally):

sql>select str_to_date('2008-09-19-18.40.09.812000', '%y-%m-%d-%h.%m.%6s'); +--------------------------+ | str_to_date_single_value | +==========================+ | 2008-09-19               | +--------------------------+ 1 tuple (0.312ms) 

i'm not sure whether str_to_date built in or whether created ages ago , forgot.

create function str_to_date(s string, format string) returns date external name mtime."str_to_date"; 

edit: expected output like

+---------------------------------+ | str_to_timestamp_single_value   | +=================================+ | 2008-09-19 18:40:09.812000      | +---------------------------------+ 

monetdb time conversion functions listed in :

  • [monetdb installation folder]\monetdb5\lib\monetdb5\createdb\13_date.sql.

besides str_to_date function, there str_to_timestamp function.

the syntax of format string follows the mysql one.

example :

select sys.str_to_timestamp('2016-02-04 15:30:29', '%y-%m-%d %h:%m:%s'); 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -