Description

FDateTime is not correctly formatted by As Date Time when using any dates before January 1st, 1970.

From a conversation on Slack with MaxP:
this is probably an underflow
the ICU based string formatter converts the FDateTime to a unix timestamp, which is then formatted as a string
so you probably can't format any dates before January 1st 1970, because that's when the Unix epoch starts
that's a bug for the localization team

Reproduced in 4.7 branch from GitHub (4.7.4) and in Main (//depot/UE4/Promotable-CL-2495212)

Steps to Reproduce

1. Open any project
2. Create a new Actor Blueprint
3. Add a DateTime variable
4. Leave the default value (0001.01.01-00.00.00)
5. Get the DateTime variable > As Date Time > Print Text
6. Attach to Event Begin Play
7. PIE

Result:
Print String returns: "Jun 7, 1906, 1:35:44 PM". If the default is set to anything after 01/01/1970, the date/time is shown correctly (UTC-5h).

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Fixed
ComponentUE - Editor - UI Systems - Localization
Affects Versions4.7.34.8
Target Fix4.9
Fix Commit2500391
CreatedMar 30, 2015
ResolvedJul 14, 2015
UpdatedApr 27, 2018