Monday, 15 March 2010

c# - Convert .NET date/ time format string to Javascript date/ time format string -



c# - Convert .NET date/ time format string to Javascript date/ time format string -

is there javascript library or other mechanism allow me pass .net date/ time format string (i.e., yyyy-mm-dd hh:mm:ss) javascript function , have parse supplied datetime value accordingly? i've been looking while can't seem find looking for.

my imagined usage allow me provide custom format string .net provider, , allow existing javascript libraries (like kendo) render date/time consistently.

since there seem confusion asking, seek more detailed:

i have user preferences table allows users take format of dates, timestamps, , times, among other things, , customizable using .net string formatting. rendering these easy .net application.

however, using kendo, , collect raw date/time info server; need have info renders formatted consistently between javascript library , .net rendering engine.

if can in .net application, when convert datetime object string this:

dtstr = dt.tostring("o"); // iso 8601 standard date time format

that way won't have worry locale based differences on date time strings , languages should able handle format without problem

c# javascript .net function kendo-ui

No comments:

Post a Comment