TimestampOffset.withDateTimeAndOffset constructor

TimestampOffset.withDateTimeAndOffset({
  1. required DateTime dateTime,
  2. required TimeZoneOffset timeZoneOffset,
})

Creates a new timestamp offset object with the given value.

The DateTime is a local date and time in UTC.

Parameters:

  • dateTime — The date time.
  • timeZoneOffset — The time zone offset.

Implementation

factory TimestampOffset.withDateTimeAndOffset({
  required DateTime dateTime,
  required TimeZoneOffset timeZoneOffset,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreDateTime = dateTime.toArcGIS();
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_TimestampOffset_createWithDateTimeAndOffset(
      coreDateTime._handle,
      timeZoneOffset._handle,
      errorHandler,
    );
  });
  final TimestampOffset object = TimestampOffset._withHandle(handle);
  object._timeZoneOffset.cache(timeZoneOffset);
  return object;
}