Search Issue Tracker

Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.

Postponed

Votes

12

Found in

5.3.0f4

Issue ID

762807

Regression

No

JsonUtility does not serialize/deserialize DateTime formats

Serialization

-

Repro steps:
1) Open the project and only scene in it
2) Play the scene
3) Inspect the Console - notice that no result is given in the WarningLog with serialized JSON object (see screenshot)

Reproduced in: 5.4.0b2; 5.3.1p3
No JSONUtility in previous versions

Comments (9)

  1. Ardito92ITA

    Sep 29, 2023 12:46

    it is unacceptable that after 7 years this bug is still present.

  2. Spip5

    Dec 02, 2020 14:53

    This is still an issue in Unity 2019.3

  3. JaviTheGreat

    Jul 28, 2020 00:00

    This is still an issue in Unity 2019.2.19f1

  4. jdnichollsc

    Mar 12, 2018 15:47

    same issue with the last stable version of Unity, 2017.3. Check the example to reproduce this issue https://github.com/proyecto26/RestClient#example-

  5. petersvp

    Jan 12, 2018 15:46

    The JsonUnility cannot decode even it's own encoded value. bool variable with FromJson fails for string "true"

  6. AmazingRuss

    Jun 01, 2017 18:07

    Please fix this! I spent a great deal of effort convincing the team to use JsonUtility instead of add ons, and this bug makes me look like a putz.

  7. deadlyfingers

    Nov 29, 2016 12:11

    There is a workaround for this.
    You can use a private string field for serialization then have a method to do the conversion:

    [SerializeField]
    private string createdAt;
    private DateTime? _createdAt;

    public DateTime? CreatedAt ()
    {
    if (_createdAt == null) {
    _createdAt = Convert.ToDateTime (createdAt);
    }
    return _createdAt;
    }

  8. Olly

    Aug 07, 2016 16:46

    I've just started noticing the same issue. Only effects children of a parent object that also has DateTime as a type.

  9. unity_john_doe

    Jun 18, 2016 00:24

    Please, please, please, get this fixed!

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.