I am using Date.toLocaleString() in my app to get a string representation of the date – I only want the date (ie. Apr 5, 2012) without the time elements, is this possible?
However I achieve this I need it to be multi language so ‘5/4/2012’ is no good as US dates are MM/DD/YYYY rather than DD/MM/YYYY for the UK.
Thanks
As mentioned in the documentation, this method is deprecated. Instead, you should use a
DateFormat(such asSimpleDateFormator the built-in ones) which makes it easy to specify date patterns.For example: