日期识别问题 [英] date recognition problem

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

问题描述

尊敬的先生/女士



i我正在开发一个网站问题是在客户端日期在我的数据库中插入MM / dd / yyyy
格式

但在服务器端以dd / MM / yyyy格式插入日期,以便在服务器网站上正确执行

但在我选择时在客户端日期为26/06/2013



它显示异常,因为字符串未被识别为有效日期时间。

帮我解决这个

Dear sir/ma'am

i am developing a website the problem is that at client side date insert in my database as MM/dd/yyyy
format
but at server side the date insert in dd/MM/yyyy format so that at server website perform properly
but at client side when i select date as 26/06/2013

it shows exception as string not recognised as valid date time .
help me regarding this

推荐答案

作为http标头的一部分,当客户端发出请求时,他们会调出计算机的文化信息。



此文化信息可用于查找当前用户的预期日期格式。



您需要研究文化信息的使用,因为正确实现了这一点将让您不知道客户如何输入日期并自动将其转换为您想要的格式。



在.NET Framework中使用DateTime编写最佳实践 [ ^ ]
As part of the http header, when a client makes a request, they pass up the culture information for their computer.

This culture information can be used to find the expected date format from the current user.

You need to research the use of culture information as correctly implementing this will allow you be ignorant of how the client inputs the date and automate converting it to your desired format.

Coding Best Practices Using DateTime in the .NET Framework[^]


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

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