mysql数据库的日期格式 [英] date format of the mysql database

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

问题描述

你好朋友
我想知道如果我更改日期格式或系统的位置会影响MySQL格式的日期格式吗?

hello friend
i want to know that if i change the date format or the location of the my system it will affect the date format of MySQL format?

推荐答案

通常,您不应该在数据库中使用任何日期格式-因为您不知道用户在显示计算机上所喜欢的显示格式,因此距离可能非常非常长.

实际上,MySql转换默认为yyyy-MM-dd(就像Sql Server一样),这是一个更好的主意,不要搞砸了-将日期作为Date或DateTime值返回给您的应用程序,并进行后处理在那里将其转换成用户喜欢的格式.
Generally, you should not use any date format with a database - since you don''t know the display format preferred by the user on the display machine, which could be a very, very long way away.

In fact, MySql conversions default to yyyy-MM-dd (just like Sql Server) and it is a much, much better idea not to mess with this - return the date to your application as a Date or DateTime value, and post-process it into the user preferred format there.


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

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