toOffsetTime method
Converts this DateTime to a OffsetTime, ignoring the timezone.
// Assuming the current offset is +08:00
DateTime(2023, 10, 10, 10, 30).toOffsetTime(); // 10:30+08:00
DateTime.utc(2023, 10, 10, 10, 30).toOffsetTime(); // 10:30Z
Implementation
OffsetTime toOffsetTime() => OffsetTime(
Offset.fromMicroseconds(timeZoneOffset.inMicroseconds),
hour,
minute,
second,
millisecond,
microsecond,
);