Skip to content

Should we use Instant here? #8

Description

@olexiyb
/// Returns the system start date
pub fn start_date(&self) -> &DateTime<Utc> {
    &self.proto.started_at
}

/// Returns the number of seconds since the system started
pub fn uptime(&self) -> u64 {
    let now = Utc::now();
    now.time()
        .signed_duration_since(self.start_date().time())
        .num_seconds() as u64
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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