Last post Aug 06, 2016 09:30 PM by bruce (sqlwork.com)
Aug 06, 2016 02:42 AM|kmcnet|LINK
Hello everyone and thanks for your help in advance. I have a web api that returns several datetime columns within the returned JSON. Format example is 2016-07-15 11:01:54.210. My consuming page needs to format the date in mm/dd/yyyy format. My question
is should I convert the datetime prior to the return of the data, or should I format the date client side and how do I do it? Any help would be appreciated.
Aug 06, 2016 09:30 PM|bruce (sqlwork.com)|LINK
as its not a valid ISO format which would be: "2016-07-15T11:01:54.210Z" (UTC), dropping the time it becomes valid. (.net does not support ISO dates, but newtonsoft does support ISO dates).
note: "07/15/2016 11:01:54" is a valid local date format (assumes locale == US)
note 2: "2016-07-15" is a valid ISO date and impies midnight zulu time or "Thu Jul 14 2016 17:00:00 GMT-0700 (PDT)" in my timezone.