tryParseSecondsSinceEpoch static method

DateTime? tryParseSecondsSinceEpoch(
  1. int? seconds
)

Parses a date time from seconds since epoch. If seconds is null, null is returned.

Implementation

static DateTime? tryParseSecondsSinceEpoch(int? seconds) {
  if (seconds == null) {
    return null;
  }
  return DateTime.fromMillisecondsSinceEpoch(seconds * 1000);
}