views:

35

answers:

1

I am working on an ASP .net MVC application.

I have a System.DateTime? property say creationDate, which gets its value assigned from controller code. In my javascript I have access to this value, and I wanted to display this value in mm/dd/yyyy format in my grid. But I am not sure on how to convert System.Datetime? of c# to a javscript date or datestring value? Any help would be appreciated.

+2  A: 

You can instantiate a new Date() with arguments for year, month and day. However, months is zerobased (0 for january).

just produce the valid javascript in your view.

var d = new Date(2010, 2, 15);

jishi
Vow. Gr8 thanks
SARAVAN