I can convert a Delphi TDate to ISO 8601 format easily using this:
DateTimeToString(result, \'yyyy-mm-dd\', myDate);
What\'s the idiomatic
For more flexibility, you could consider Marco van de Voort's scandate routine which handles your string in any format:
var D: TDateTime; begin D := ScanDate('yyyy-mm-dd', '2011-07-11');
See final version (7kB .zip) as added to FPC.