App Xamarin showing an hour in advance

Asked

Viewed 69 times

-1

Here in the company we have an application to beat point, in this application is shown the current time on the screen.

Ex: viewModel.HoraAtual = DateTime.Now.ToString("HH:mm:ss");

It is always showing an hour ahead on some cell phones, someone has been through this problem?

  • he doesn’t have the Z table (I don’t remember the rest) that sets the Zome Team outdated? type, because of "no daylight saving time"

1 answer

0

I believe the problem may be the definition of the wrong Timezone on the devices. I’ve seen a similar problem in the past be solved with Timezone conversions. Can you test to see if it would solve in your case?

TimeZoneInfo.ConvertTime(DateTime.UtcNow, TimeZoneInfo.Utc, TimeZoneInfo.FindSystemTimeZoneById(TimeZoneInfo.Local.Id));
  • I will test, but I believe it is a problem of daylight saving time, when I put the region of Bahia that has no daylight saving time works, I am also trying to use the Baseutcoffset where daylight saving time is not considered, I published a version of the App, if it works I inform you

Browser other questions tagged

You are not signed in. Login or sign up in order to post.