Skip to content

Easy way to convert timestamp to UTC object? #88

Closed
@amandasaurus

Description

As near as I can tell, the only way to convert a timestamp (i.e. number of seconds since UNIX epoch¹) is with NaiveDateTime::from_timestamp(), however that returns a DateTime without a timezone... but if we know the unix epoch time, then we know exactly what second it is? a timestamp of 60 is 00:01 UTC on 1st Jan 1970, it's not like it can be in a some other timezone.

How about some method that'll take a unix epoch and return a DateTime in UTC timezone?


¹ I'm aware of leap seconds

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions