0

I am working in MVC4 project .In this project i need to convert UTC time ,which i am getting from server to brazil time zone.

How can i convert UTC time to brazil time in noda time library.

Mahajan344
  • 2,492
  • 6
  • 39
  • 90
  • How are you receiving the UTC time? What do you then want to do with the value in the Brazilian time zone? – Jon Skeet Oct 29 '13 at 23:39

1 Answers1

2

Fundamentally, if you can get the value as an Instant to start with, it's as simple as:

var instant = ...; // However you're receiving that
var zone = DateTimeZoneProviders.Tzdb["America/Sao_Paulo"];
var inBrazil = instant.InZone(zone);
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194