Making `Schema.DateTimeUtcFromSelf` Serializable for JSON Storage

How can I make Schema.DateTimeUtcFromSelf Serializable? I need to store it in JSON, however encoding and then stringifying DateTime.Utc turns into e.g 2025-01-01T00:00:00.000Z and then decoding that again fails becaue String is not DateTime.Utc.

In general can I take a Schema A and encode it into a String and then decode it back to A with all properties that are not serializable working again?
Was this page helpful?