在javascript中获取客户端计算机的日期和时间格式 [英] Get Client machine's date and time format in javascript
本文介绍了在javascript中获取客户端计算机的日期和时间格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我需要用户在javascript中设置的客户机日期和时间格式。
不在服务器端。< br $>
谢谢你的问候
Rakesh Jogani
Hello
I need client machine date and time format which is set by user in javascript.
Not at server side.
Thanks Regards
Rakesh Jogani
推荐答案
你不能在某种程度上调用函数 - 出于安全原因,JavaScript不会泄露有关底层操作系统的信息。
您可以使用toLocaleDateString()
ofDate
对象获取特定日期的字符串(如2014年12月13日),然后分析字符串以确定原始格式字符串是什么...
You can not in a way of calling a function - JavaScript does not reveal information about the underlying OS, for security reasons.
You may usetoLocaleDateString()
ofDate
object to get a string of a specific date (like 12/13/2014) and then analyze the string to decide what was the original formatting string...
这篇关于在javascript中获取客户端计算机的日期和时间格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文