Skip to content

[devkit/utilities] Implement Unix timestamp helpers #379

Description

@Tinna23

Helpers for working with Stellar ledger timestamps.

Functions:

pub fn now_unix_ms() -> u64
pub fn unix_ms_to_datetime(ms: u64) -> DateTime<Utc>
pub fn datetime_to_unix_ms(dt: DateTime<Utc>) -> u64
pub fn ledger_close_time_to_unix_ms(close_time: u64) -> u64

Files to touch:

  • packages/devkit/src/utilities/time.rs
  • packages/devkit/Cargo.toml — add chrono dep

Metadata

Metadata

Assignees

No one assigned

    Labels

    devkitScoped to packages/devkitintermediateRequires domain knowledgeutilitiesShared helpers and converters

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions