DateTimeOffsetExtensions extension

Extension methods for DateTime to handle timezone offset formatting.

This extension provides utilities for converting DateTime objects to ISO 8601 strings with timezone offset information, which is essential for proper date/time serialization in JSON APIs.

on

Methods

getTimezoneOffsetString() String

Available on DateTime, provided by the DateTimeOffsetExtensions extension

Returns the timezone offset as a string in the format ±hh:mm.
toIso8601StringWithOffset() String

Available on DateTime, provided by the DateTimeOffsetExtensions extension

Converts this DateTime to an ISO 8601 string with timezone offset.