数据库安全的日期/时间字符串? [英] Database-safe Date/Time String?

查看:124
本文介绍了数据库安全的日期/时间字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



将这个 YYYY- MMM-DD HH:MM:SS 在MySQL,SQLite 2& 3,MsSQL和其他常见的数据库?

> 2010年7月12日12:00:00 pm 你可以选择一个已定义的标准,比如 / iso / date_and_time_formatrel =nofollow noreferrer>日期和时间的ISO标准。这是非常普遍的,易于使用和理解,作为一个定义的标准,你可以说所有的日期时间必须是ISO 8601,并完成它。不用担心场所或文化混乱。

Which format of a date/time string would be considered cross-platform, cross-database, universal safe?

Would this YYYY-MMM-DD HH:MM:SS be considered safe to use in MySQL, SQLite 2 & 3, MsSQL and other common databases?

How about something like 2010-Jul-12 12:00:00pm?

解决方案

You could pick a defined standard, such as the ISO standard for date and times. It's pretty universal and easy to use and understand, and as a defined standard you can just say "all datetimes must be ISO 8601" and be done with it. No worries about locale or cultural confusion.

这篇关于数据库安全的日期/时间字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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