[Javascript] Date Locale

Nick Fitzsimons nick at nickfitz.co.uk
Sat Nov 11 09:30:04 CST 2006


On 10 Nov 2006, at 23:05:03, John Moore wrote:

> Aside from detecting the language of the browser..
>
> Is there anyway to detect the users "locale" letting such that the  
> date can be displayed in the correct format for that user..??
>
> John..

var someDate = new Date();
alert(someDate.toLocaleString());

<http://developer.mozilla.org/en/docs/ 
Core_JavaScript_1.5_Reference:Global_Objects:Date:toLocaleString>
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ 
script56/html/0901afcb-126b-4ed7-bd6a-2301d50e2326.asp>

HTH,

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/






More information about the Javascript mailing list