You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey,
I needed this for interop with another language (scala), there are possibly other betters ways to achieve this, but as every language implements ISO8601 (de-)serialization to/from JSON differently it would be nice to have a couple of the more popular string formats of the standard ready to help people whose goal is interop with other languages/libs. I did something like this but hardcoded the 'Z' as it is commonly used/expected as a shortcut for the 0 UTC offset, but it could be made more generic.
type ISO8601UTCDate() =
interface ITypeTransform with
member x.targetType () = (fun _ -> typeof<string>) ()
member x.toTargetType value = (fun (v: obj) -> (v :?> DateTime).ToString("yyyy-MM-ddTHH:mm:ssZ") :> obj) value
member x.fromTargetType value = (fun (v: obj) -> DateTime.Parse(v :?> string) :> obj) value
The text was updated successfully, but these errors were encountered:
Hey,
I needed this for interop with another language (scala), there are possibly other betters ways to achieve this, but as every language implements ISO8601 (de-)serialization to/from JSON differently it would be nice to have a couple of the more popular string formats of the standard ready to help people whose goal is interop with other languages/libs. I did something like this but hardcoded the 'Z' as it is commonly used/expected as a shortcut for the 0 UTC offset, but it could be made more generic.
The text was updated successfully, but these errors were encountered: