Now

Now(a) :: # (opaque)

A small effectful module to get the current date/time as Date, Time, or DateTime objects in a single call.

import pf.Utc
import dt.Now

now = Now.create({
    now!: Utc.now!,
    now_to_nanos: Utc.to_nanos_since_epoch,
})
dt = now.date_time!()
create : { now! : () => a, now_to_nanos : a -> I128 } -> Now(a)
date_time_from : a, (a -> I128) -> DateTime

Convert a raw time value and converter function to a DateTime.

date_from : a, (a -> I128) -> Date

Convert a raw time value and converter function to a Date.

time_from : a, (a -> I128) -> Time

Convert a raw time value and converter function to a Time.

date_time! : Now(a) => DateTime

Get the current system time as a DateTime.

date! : Now(a) => Date

Get the current system time as a Date.

time! : Now(a) => Time

Get the current system time as a Time.