ZonedDateTime.from constructor

ZonedDateTime.from(
  1. Timezone timezone,
  2. int year, [
  3. int month = 1,
  4. int day = 1,
  5. int hour = 0,
  6. int minute = 0,
  7. int second = 0,
  8. int millisecond = 0,
  9. int microsecond = 0,
])

Creates a ZonedDateTime.

final singapore = Timezone('Asia/Singapore');
ZonedDateTime.from(singapore, 2023, 5, 11);

Implementation

factory ZonedDateTime.from(Timezone timezone, int year, [
  int month = 1,
  int day = 1,
  int hour = 0,
  int minute = 0,
  int second = 0,
  int millisecond = 0,
  int microsecond = 0,
]) => ZonedDateTime._convert(timezone, DateTime.utc(year, month, day, hour, minute, second, millisecond, microsecond));