Sql server日期列格式 [英] Sql server date Column format

查看:140
本文介绍了Sql server日期列格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我有一个列在sql server表中,类型为Date,其默认设置是yyyy-MM-dd我想要像dd-MM-yyyy
这样做我可以如何做?

解决方案


其默认设置为yyyy-MM-dd


不,不行没有与该字段相关联的格式设置信息。



该值不是由数据库格式化,仅作为时间点返回。将该值格式化为其文本表示是通过从数据库获取数据的应用程序完成的。



因此,您无法在数据库中进行更改如何格式化日期值,您必须更改显示数据的位置。


Hello guys i have one column in sql server table with type Date its default setting is yyyy-MM-dd i want to chage it like dd-MM-yyyy How can i do it?

解决方案

its default setting is yyyy-MM-dd

No, it's not. There is no formatting information at all associated with the field.

The value is not formatted by the database, it's returned only as a point in time. Formatting that value into it's textual representation is done by the applcation that is getting the data from the database.

So, there is nothing that you can do in the database to change how the date value is formatted, you have to change that where the data is displayed.

这篇关于Sql server日期列格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆