如何检测用户的区域设置日期和时间格式

Ser*_*giu 13 javascript datetime

是否有可能使用纯Javascript确定FORMAT在其操作系统(Windows,Linux,MAC OS等)上配置用户的日期时间?

提前致谢.

编辑:我知道方法toLocaleString(),但这不能帮助我获得客户端在其本地计算机上配置的格式.

Mar*_*oek 0

像这样的东西?

<script type="text/javascript">

    var d=new Date();
    document.write("Original form: ");
    document.write(d + "<br />");
    document.write("Formatted form: ");
    document.write(d.toLocaleString());

    //calculate change of the 2 dates
</script>
Run Code Online (Sandbox Code Playgroud)

  • &gt;&lt; 我误读了你的问题。我认为你应该改变你的问题:-) (2认同)