Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

关于Date对象我用火狐和谷歌浏览器输出的结果和例子不完全一样 #269

Copy link
Copy link
@suzhenghui-sky

Description

@suzhenghui-sky
Issue body actions

https://wangdoc.com/javascript/stdlib/date
例子:
var d = new Date(2013, 0, 1);

d.toLocaleString('en-US') // "1/1/2013, 12:00:00 AM"
d.toLocaleString('zh-CN') // "2013/1/1 上午12:00:00"

d.toLocaleDateString('en-US') // "1/1/2013"
d.toLocaleDateString('zh-CN') // "2013/1/1"

d.toLocaleTimeString('en-US') // "12:00:00 AM"
d.toLocaleTimeString('zh-CN') // "上午12:00:00"

火狐:123.0(64位)
var d = new Date(2013, 0, 1);
undefined
d.toLocaleString('en-US')
"1/1/2013, 12:00:00 AM"
d.toLocaleString('zh-CN')
"2013/1/1 00:00:00"
d.toLocaleDateString('en-US')
"1/1/2013"
d.toLocaleDateString('zh-CN')
"2013/1/1"
d.toLocaleTimeString('en-US')
"12:00:00 AM"
d.toLocaleTimeString('zh-CN')
"00:00:00"

谷歌:22.0.6261.57(正式版本) (64 位)
var d = new Date(2013, 0, 1);
undefined
d.toLocaleString('en-US')
'1/1/2013, 12:00:00 AM'
d.toLocaleString('zh-CN')
'2013/1/1 00:00:00'
d.toLocaleDateString('en-US')
'1/1/2013'
d.toLocaleDateString('zh-CN')
'2013/1/1'
d.toLocaleTimeString('en-US')
'12:00:00 AM'
d.toLocaleTimeString('zh-CN')
'00:00:00'

请问这是什么原因,我用的都是中文版浏览器,是哪里出错了?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.