Question: Probably a super simple solution but I'm clearly missing something.

I have a string object with value "2020/07/29 13:30:00".

How can I parse that into a DateTimeOffset object and make the assumption that the time zone of that parsed time is "GMT Standard Time" for example, or any TimeZoneInfo I wish to specify preferably?

How can I then take that DateTimeOffset, and return its Utc time but to any specified time zone of my choice?

Many thanks

Answer: 
Try the [DateTimeOffset.ParseExact](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset.parseexact?view=netcore-3.1#System_DateTimeOffset_ParseExact_System_String_System_String_System_IFormatProvider_System_Globalization_DateTimeStyles_) overload that accepts a [DateTimeStyles](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.datetimestyles?view=netcore-3.1) parameter.

This code:

```
var dt=DateTimeOffset.ParseExact("2020/07/29 13:30:00","yyyy/MM/dd HH:mm:ss",
                     CultureInfo.InvariantCulture,DateTimeStyles.AssumeUniversal);

```

Returns `2020-07-29T13:30:00.0000000+00:00`

There's no `GMT Standard Time`, that's a very unfortunate name used in Windows that somehow manages to mix up British and UTC time to the point that no-one knows what it means without looking at the docs. This was thoroughly discussed and explained in this question: [Difference between UTC and GMT Standard Time in .NET](https://stackoverflow.com/questions/2292334/difference-between-utc-and-gmt-standard-time-in-net). As one of the answers explains :

> 
> The names GMT Standard Time and GMT Daylight Time are unknown outside of Redmond. They are mythical animals that appear only in the bestiary called the Windows Registry.
> 
> 
> 

If you wanted to assume British time and your machine uses a British timezone, you can use `DateTimeStyles.AssumeLocal`
This function should convert your date time string (with assumption this is GMT Standard Time) to any other timezone:

```
    public static DateTime? ToUTCTimeZone(string sDate, string timeZone)
    {

        DateTime utcDate = DateTime.Parse(sDate);

        DateTimeOffset localServerTime = DateTimeOffset.Now;
        utcDate = DateTime.SpecifyKind(utcDate, DateTimeKind.Utc);

        TimeZoneInfo cstZone = TimeZoneInfo.FindSystemTimeZoneById(timeZone);
        if (cstZone == null)
            return null;

        return TimeZoneInfo.ConvertTimeFromUtc(utcDate, cstZone);

    }//ToUTCTimeZone

```