KevinZesi
5 years agoOccasional Contributor
Date.toLocaleString not working
Hello there, I have a question regarding the Date object in JavaScript. I want to use the following: function myFunction()
{
...
var myDate = new Date(year, month-1, day);
var options = ...
- 5 years ago
The problem with .toLocaleString not working as documented in JavaScript documentation should be raised as a support issue directly with SmartBear. I reproduced the problem and, you are correct, counter to JavaScript documentation, the method is not operating as expected.
In the meantime, consider using https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqconvert/datetimetoformatstr.html to create your own formatting if there's a particular formatting you want for dates.