[MonetDB-users] [Question]How to change the format of datetime?
Are there any functions like date_format in MonetDB, I want to do something like date_format(zncsrq, '%Y%m%d', that is Mysql's function, in MonetDB. Best regards!
On Fri, Jul 25, 2008 at 02:11:46PM +0800, chenhao333333 wrote:
Are there any functions like date_format in MonetDB, I want to do something like date_format(zncsrq, '%Y%m%d', that is Mysql's function, in MonetDB.
You can use the following functions
create function str_to_date(s string, format string) returns date external name mtime."str_to_date";
create function date_to_str(d date, format string) returns string external name mtime."date_to_str";
See man strftime and strptime for more info on the format strings.
Niels
Best regards!
__________________________________________________________
22Ôª³¬Öµ·¹Ãæ,8.5ÕÛ´¿Õä±ÈÈø,±Øʤլ¼±ËÍ[1]ÍøÉϵã²ÍÓŻݶà
References
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
participants (2)
-
chenhao333333
-
Niels Nes