cloneDate function

DateTime cloneDate(
  1. DateTime orig, {
  2. int? year,
  3. int? month,
  4. int? day,
  5. int? hour,
  6. int? minute,
  7. int? second,
  8. int? millisecond,
  9. int? microsecond,
})

Implementation

DateTime cloneDate(
  DateTime orig, {
  int? year,
  int? month,
  int? day,
  int? hour,
  int? minute,
  int? second,
  int? millisecond,
  int? microsecond,
}) {
  return DateTime(
    year ?? orig.year,
    month ?? orig.month,
    day ?? orig.day,
    hour ?? orig.hour,
    minute ?? orig.minute,
    second ?? orig.second,
    millisecond ?? orig.millisecond,
    microsecond ?? orig.microsecond,
  );
}