Description

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.

Steps to Reproduce

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.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-255409 in the post.

0
Login to Vote

Unresolved
ComponentUE - CoreTech
Affects Versions5.5.3
Target Fix5.7
CreatedMar 12, 2025
UpdatedApr 3, 2025
View Jira Issue