Jiffy.parseFromMicrosecondsSinceEpoch constructor
Constructs a Jiffy instance from a microsecondsSinceEpoch of type
int.
The microsecondsSinceEpoch represents the number of microseconds since
epoch time, which is January 1, 1970, 00:00:00 UTC.
This method also includes an optional isUtc parameter:
- If
isUtcistrue, the parsed date-time will be treated as UTC. - If
isUtcisfalse(default), the parsed date-time will be treated as local time.
final now = DateTime.now();
final jiffy1 = Jiffy.parseFromMicrosecondsSinceEpoch(now.microsecondsSinceEpoch);
Implementation
factory Jiffy.parseFromMicrosecondsSinceEpoch(int microsecondsSinceEpoch,
{bool isUtc = false}) {
return Jiffy._internal(DateTime.fromMicrosecondsSinceEpoch(
microsecondsSinceEpoch,
isUtc: isUtc));
}