Times and GMT offsets often lead to confusion.
Firstly, what does "it's 8:15am here" mean? GMT? London? Somewhere else? Secondly, what does "GMT + 2" mean?
In the first case the honest answer is there is no way to tell without a little more context. In the second case it's more down to people misunderstanding GMT offsets - many people believe that "GMT == London" so "GMT + 2 == London + 2" - of course that's not correct, "GMT == London in winter; BST (GMT + 1) == London in summer". So "GMT + 2" is "GMT + 2", i.e. somewhere like Berlin in the summer or Nicosia in the winter.
For these reasons many situations where time is important use GMT or another timezone but clearly state the offset, e.g. "3:15am, EDT".
To answer your question you have a few options
- Allow for the timezone in the things you're doing; maybe changing it to GMT to make things easier - you'd then be doing GMT +/- rather than GMT - 4 +/-.
- Alternatively, you could do something along the same lines as the answer to this question.
Something like this
DateTimeOffset date = new DateTimeOffset(2017, 6, 20, 22, 09, 0, 0, TimeSpan.FromHours(-4));
// 20 June 2017, 22:09, GMT-4
public static DateTimeOffset ParseIso8601(string iso8601String)
{
return DateTimeOffset.ParseExact(
iso8601String,
new string[] { "yyyy-MM-dd'T'HH:mm:ss.FFFK" },
CultureInfo.InvariantCulture,
DateTimeStyles.None);
}