I am using DateTime.Now to show something according to today’s date, and when working locally (Malta, Europe) the times appear correctly (obviously because of the Time Zone) but ofcourse when I upload it to my hosting server (USA), DateTime.Now does not represent the correct time zone.
Therefore, in my code, how can I convert DateTime.Now to correctly return the time from a GMT + 1 timezone ?
Use the TimeZoneInfo class found in System.Core;
You must set the DateTimeKind to DateTimeKind.Utc for this.
Only if you’re using .Net 3.5 though!