c# - How can I format date using json.SerializerSettings.Converters to look like 1288323623006 -
i using following date filter in webapi application:
json.serializersettings.converters.add( new isodatetimeconverter { datetimeformat = "dd-mm-yyyy hh:mm" });
i started use front end not understand dates. if remember correctly due way milliseconds formatted many digits.
what need date format this:
1288323623006
can suggest how can using serializer. different default?
you don't want use isodatetimeconverter
@ - possibly want use javascriptdatetimeconverter
. convert new date(...)
right value - believe include new date(...)
part. if don't want that, you'll need write own converter.
it shouldn't hard write converter - although need decide how handle different kinds of datetime
. example, if you're asked convert datetime
kind
of unspecified
, want assume it's in utc, or in system local time zone, or else?
once you've got appropriate "instant" in time, need find number of milliseconds between , unix epoch (1st january 1970 00:00:00, utc) , convert number of milliseconds string.
Comments
Post a Comment