Skip to content

Using repr on DateTime shows pretty-printed version #29909

@omus

Description

@omus

According to the docstring for repr:

Note that repr(x) is usually similar to how the value of x would be entered in Julia

Unfortunately this is not the behaviour of Date and DateTime:

julia> using Dates

julia> x = Date(2018)
2018-01-01

julia> repr(x)
"2018-01-01"

julia> y = DateTime(2018)
2018-01-01T00:00:00

julia> repr(y)
"2018-01-01T00:00:00"

Metadata

Metadata

Assignees

No one assigned

    Labels

    datesDates, times, and the Dates stdlib moduledisplay and printingAesthetics and correctness of printed representations of objects.good first issueIndicates a good issue for first-time contributors to Julia

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions