Tony
Tony

Reputation: 10208

Datetime.Today in GMT in c#

I want to convert DateTime.Today to GMT time.

i.e. If I am in L.A. and it is 11pm of 22/02/2012 I want DateTime.Today to be 23/02/2012 because it will be that day in GMT time.

Upvotes: 68

Views: 51417

Answers (3)

Paul Suitela
Paul Suitela

Reputation: 1

DateTime LocalToGMT = DateTime.Now.ToUniversalTime().AddHours(TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time").BaseUtcOffset.Hours);

Upvotes: -1

rirajat
rirajat

Reputation: 99

DateTime.UtcNow will give you the current universal time.

Upvotes: -2

Carsten Schütte
Carsten Schütte

Reputation: 4558

There is no DateTime.UtcToday, but you can try DateTime.UtcNow.Date

Upvotes: 187

Related Questions