SQL Server中的DateTime

发布于 2025-01-31 23:17:38 字数 178 浏览 3 评论 0原文

我在表中有一个列,显示last_updated_date。当前,它在yyyy-mm-dd HH中:MM:SS格式,我希望它以dd-mm-yyyy HH:MM:MM:SS格式。

列的数据类型为DateTime

I have a column in table which is showing last_updated_date. Currently it is in yyyy-mm-dd hh:mm:ss format and I want it in dd-mm-yyyy hh:mm:ss format.

Datatype of the column is datetime.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寂寞美少年 2025-02-07 23:17:38

此代码为您提供不同格式的日期,

select FORMAT(last_updated_date,'dd-MM-yyyy hh:mm:ss ') as last_updated_date from table_name

请参阅

https://www.mssqltips.com/sqlservertip/2655/format-sql-server-dates-with-format-function/

This code gets you date

select FORMAT(last_updated_date,'dd-MM-yyyy hh:mm:ss ') as last_updated_date from table_name

For different formats please refer

https://www.mssqltips.com/sqlservertip/2655/format-sql-server-dates-with-format-function/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文