DateTime 构造函数

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

在本地时区中构造一个指定的 DateTime 实例。

例如,要创建代表 2017 年 9 月 7 日下午 5:30 的 DateTime 对象

final dentistAppointment = DateTime(2017, 9, 7, 17, 30);

实现

DateTime(int year,
    [int month = 1,
    int day = 1,
    int hour = 0,
    int minute = 0,
    int second = 0,
    int millisecond = 0,
    int microsecond = 0])
    : this._internal(year, month, day, hour, minute, second, millisecond,
          microsecond, false);