JavaScript toLocaleString () method
Examples
According to the local time of the Date object to a string:
var d=new Date();
var n=d.toLocaleString();
var n=d.toLocaleString();
n output:
try it"
Definition and Usage
toLocaleString () method can be based on the local time of the Date object to a string and returns the result.
Browser Support
All major browsers support toLocaleString () method
grammar
Date.toLocaleString()
return value
Type | 描述 |
---|---|
String | 日期和时间以字符串形式输出。 |
technical details
JavaScript version: | 1.0 |
---|