Skip to content

@effect DateTime Get unix timestamp of a Date #6148

@AlfGoto

Description

@AlfGoto

What is the problem this feature would solve?

hello, since we already have a DateTime.toEpochMillis that get us the timestamp of a date, could we have something to get the Unix timestamp of a date ? so in seconds ?

I surely have missed something but its painful to do thing like below whenever i need an unix timestamp :(

const reservationEventTtlUnix = Math.round(
   DateTime.toEpochMillis(yield* DateTime.now) / 1000,
)

i don't know maybe something like DateTime.toEpochSeconds

What is the feature you are proposing to solve the problem?

DateTime.toEpochSeconds(DateTime) maybe ?

What alternatives have you considered?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions