Hi Niels, sure. Here it is:
dateadd(ss,1111111111,'1970-01-01')
This would add 1111111111 seconds to the epoch 1970-01-01 and give
2005-03-18 01:58:31.000
Reference: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=66858 and http://sqltutorials.blogspot.com/2007/06/sql-dateadd-function.html
Thanks.
DATEADD isn't a standard SQL function, so could you tell us theOn Fri, Mar 20, 2009 at 11:16:07AM -0700, Yue Sheng wrote:
> MonetDB doesn't seem to support DATEADD function. I need it to
> convert Unix time on-the-fly (700milliion times for each
> query!) . Could anyone recommend a fast way to do this please?
> Thanks
expected semantics?
For string to date conversions you could load the file (src/sql/date.sql).
Or run
create function str_to_date(s string, format string) returns date
external name mtime."str_to_date";
This adds the function str_to_date, which needs a string column and
a format string. It depends on strptime, so you could do a man
strptime for details on the format string.
Niels
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> MonetDB-users mailing list
> MonetDB-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-users
--
Niels Nes, Centre for Mathematics and Computer Science (CWI)
Science Park 123, 1098 XG Amsterdam, The Netherlands
room C0.02, phone ++31 20 592-4098, fax ++31 20 592-4312
url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
MonetDB-users mailing list
MonetDB-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/monetdb-users