Format Date/Time as UTC with Timezone Offset

Here’s a quick snippet from MSDN that demonstrates how to format a date/time to UTC format with a timezone offset. (ISO 8601 compliant!)

DateTime date1 = new DateTime(2008, 4, 10, 6, 30, 0);
DateTimeOffset dateOffset = new DateTimeOffset(date1,

This will produce the following output:


Everything you ever wanted to know and more about date and time formatting can be found here.


Author: Adam Prescott

I'm enthusiastic and passionate about creating intuitive, great-looking software. I strive to find the simplest solutions to complex problems, and I embrace agile principles and test-driven development.

Leave a comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: