I\'m working with a protocol that may optionally include a time zone offset when specifying datetime information. My code is written in C# and we are using the 4.0 .NET run
If you're using it in a place where it doesn't make sense to use replace or extend (for example something that might want to output as -05:00 with a colon when passed as zzz) and the minutes don't matter you could fake it with zz00.
var date = new DateTimeOffset(2008, 8, 1, 0, 0, 0, new TimeSpan(-5, 0, 0));
Console.WriteLine(date.ToString("yyyy-MM-dd-HH:mm:ss(zz00)"));
// outputs 2008-08-01-00:00:00(-0500)