Hyperlinkv0.8.0-beta.28

DateTime

DateTime.layerCurrentZoneLocalconsteffect/DateTime.ts:2922
Layer.Layer<CurrentTimeZone, never, never>

Create a Layer from the system's local time zone.

Details

This layer provides the CurrentTimeZone service using the system's configured local time zone.

Example (Providing local time zone layers)

import { DateTime, Effect } from "effect"

const program = Effect.gen(function*() {
  const now = yield* DateTime.nowInCurrentZone
  return DateTime.formatIsoZoned(now)
})

// Use the system's local time zone
Effect.provide(program, DateTime.layerCurrentZoneLocal)
current time zone