The way the string prints out when you use toLocaleDateString() depends on how the local computer is configured. The idea is that the date prints if the format that your visitor wants rather than some backwards format that they don’t normally use.
If you want full control over the format that dates are displayed in from your code then take a look at http://javascript.about.com/library/bldateformat.htm where I created a format method for JavaScript that works with the PHP style string that orivides the instructions on what the date should look like. Using that you can extract a date in any format you like using one short statement.