Context:
`FJsonObjectConverter` is a built-in UE class that makes it easy to convert JSON objects to and from UStructs, including `FDateTime`, which implements a date and time.
Problem:
An uninitialized FDateTime defaults to Ticks = 0, which will be exported as
LogTemp: Warning: 0001.01.01-00.00.00
`FJsonObjectConverter::ExportCallback_WriteISO8601Dates` does not check if the provided `FDateTime` has ticks, so it will happily write a zero-ticks `FDateTime` in ISO format. `FJsonSerializerWriter::Serialize(..., FDateTime)` by contrast skips the write if the provided `FDateTime` ticks are zero.
Use `JsonObjectConverter` utilities to serialize an `FDateTime` that hasn't been initialized.
Observe: `FDateTime` with no ticks will be written in ISO format.
Expected: Either any zero-ticks `FDateTime` is skipped, or a null value is returned.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-255409 in the post.
0 |
Component | UE - CoreTech |
---|---|
Affects Versions | 5.5.3 |
Target Fix | 5.7 |
Created | Mar 12, 2025 |
---|---|
Updated | Apr 3, 2025 |