Date.fromMilliseconds constructor

Date.fromMilliseconds(
  1. int milliseconds
)

Creates a Date from the given milliseconds since epoch. If milliseconds represents a date-time, the time is truncated.

Implementation

factory Date.fromMilliseconds(int milliseconds) {
  final date = DateTime.fromMillisecondsSinceEpoch(milliseconds);
  return Date(date.year, date.month, date.day);
}