ZonedDateTime.fromEpochMicroseconds constructor

ZonedDateTime.fromEpochMicroseconds(
  1. Timezone timezone,
  2. EpochMicroseconds microseconds
)

Creates a ZonedDateTime that represents the microseconds since Unix epoch (January 1st 1970) in the timezone.

final timezone = Timezone('Asia/Singapore');
final microseconds = 1682865000000000; // 2023-04-30T14:30Z

final date = ZonedDateTime.fromEpochMicroseconds(timezone, microseconds));

print(date); // 2023-04-30T22:30+08:00[Asia/Singapore]

Implementation

ZonedDateTime.fromEpochMicroseconds(Timezone timezone, EpochMicroseconds microseconds): this._(
  timezone,
  timezone.span(at: microseconds),
  microseconds,
);