ISO 8601: Delphi way to convert XML date and time to TDateTime and back (via: Stack Overflow)

Thoug the Delphi DateUtils unit has some ISO 8601 features for calculating week numbers, you actually need to the XSBuiltIns unit for converting back and forth to ISO 8601 text representation of a DateTime.