In a recent job interview about C# someone asked me the following question:
- What is the difference between LocalTime and UniversalTime in c# and when should I use them?
After checking the documentation I found the foloowing definition for LocalTime:
The local time is equal to the Coordinated Universal Time (UTC) time plus the UTC offset.
And the following one for UniversalTime:
The Coordinated Universal Time (UTC) is equal to the local time minus the UTC offset.
So, the way I see it, UniversalTime is the reverse of LocalTime, but they both do the same thing and get the same results.
So, when should I use each one? Is there any real difference?