How to set date format in sybase?

只谈情不闲聊 提交于 2019-12-25 03:08:04

问题


How to set date format in sybase?

Currently it's inserting default date format Jan 9 2014 1:07AM to Sybase DB,But i have to insert seconds also like "20140109 01:06:46"

Is there any way i can set date format in stored proc.

please suggest me,thanks!


回答1:


select --cast(
        dateformat('Jan 9 2014 1:07AM','YYYYMMDD HH:NN:SS') --returns varchar
        --as datetime) --datetime object in database datetime format


来源:https://stackoverflow.com/questions/21013037/how-to-set-date-format-in-sybase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!