This is a migrated thread and some comments may be shown as answers.
Globalization issue while Date Formating
3 Answers 53 Views
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 18 Apr 2012, 09:02 AM
Hello,
I am facing issue while formating string date to right format.
Following is my code:

return kendo.toString(new Date(2010,04,17), "MM/dd/yyyy");<BR>

It return me date as 05/17/2010

So it as adding a day in result, I am not setting any specific culture as I want Kendo to check my current thread cluture and use it for conversion.

Can someone please let me know the cause behind this?

3 Answers, 1 is accepted

Sort by
0
Accepted
Wannes
Top achievements
Rank 1
answered on 19 Apr 2012, 08:51 AM
Hi James,

The problem here is that the JavaScript Date object expects a month value between 0 and 11, not 1 and 12.

Cheers,
Wannes.
0
James
Top achievements
Rank 1
answered on 19 Apr 2012, 11:57 AM
Oh ok got it :)
Thanks.
Asked by
James
Top achievements
Rank 1
Answers by
Wannes
Top achievements
Rank 1
James
Top achievements
Rank 1
Cat
Top achievements
Rank 1
Share this question
or