A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/Object/toLocaleString below:

toLocaleString · WebPlatform Docs

toLocaleString Summary

Returns a date converted to a string using the current locale.

Syntax
dateObj.toLocaleString()
Examples

The following example illustrates the use of the toLocaleString method.

function toLocaleStrDemo(){
    var d, s;                      
    d = new Date();                
    s = "Current setting is ";
    s += d.toLocaleString() ;       
    return(s);                     
 }
Remarks

The required dateObj is any Date object.

The toLocaleString method returns a String object that contains the date written in the current locale’s long default format.

For example, in the United States, toLocaleString returns “01/05/96 00:00:00” for January 5. In Europe, it returns “05/01/96 00:00:00” for the same date, as European convention puts the day before the month.

NotetoLocaleString should only be used to display results to a user; it should never be used as the basis for computation within a script as the returned result is machine-specific.

See also Specification

15.4.4.3 Array.prototype.toLocaleString ( ) ECMAScript® Language Specification Standard ECMA-262 5.1 Edition / June 2011

Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4