0

I do not want to convert CST to GMT or UK Time. I want to create a UK DateTime object with value of "2019-10-01 00:00:00"

Like: DateTime ukTime = new DateTime(2019,10,1); // BUT this gives me local US Central time as I live there

I can convert this "ukTime" from CST to UK Time but then it will not be 2019/10/01 in UK Time.

Mehdi Anis
  • 358
  • 1
  • 9
  • 17
  • 1
    `DateTime` doesn't have a time zone component. It's only CST because that's your system's configured time zone. – madreflection Jan 11 '20 at 00:07
  • 3
    Take a look at `DateTimeOffset` – Flydog57 Jan 11 '20 at 00:09
  • 3
    Better yet, take a look at [NodaTime](https://www.nuget.org/packages/NodaTime/). It forces you to be explicit and careful about what you want, and you'll be talking about actual time zones instead of offsets. **Time Zone != Offset** – madreflection Jan 11 '20 at 00:11
  • The last two paragraphs in the question are incorrect. The object you get won't represent any time zone in particular, as the default `Kind` property is `DateTimeKind.Unspecified` when you use that constructor. It could be intended to mean anywhere on the planet. – Matt Johnson-Pint Jan 11 '20 at 17:25

0 Answers0