public static DateTimeOffset?ConvertToDateTimeOffSetLow(string FhirDateTimeString) { Hl7.Fhir.Model.Primitives.PartialDateTime PartialDateTime; if (Hl7.Fhir.Model.Primitives.PartialDateTime.TryParse(FhirDateTimeString, out PartialDateTime)) { //var LocalTimeOffSet = DateTimeOffset.Now.Offset; //Convert to DateTimeOffset, which is done by caling ToUniversalTime(), yet this converts to UniversalTime // So we then set the timezone to the local timezone, which converts the time value to plus that timezone // So then subtract that timezone hours from the final result //Now we have the original timezone and correct time. //DateTimeOffset Low = PartialDateTime.ToUniversalTime().ToOffset(LocalTimeOffSet).Subtract(LocalTimeOffSet); DateTimeOffset Low = PartialDateTime.ToUniversalTime(); return(Low); //return PartialDateTime.ToUniversalTime().ToLocalTime(); } else { return(null); } }