TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
panse vaishali
NA
204
23.9k
Time converison
Feb 8 2018 11:17 PM
Hi
I want to convert different time zones considering day light saving in c#.
How can i do this.Please suggest a solution.
I have tried this
int timezone;
TimeZoneInfo localZone = TimeZoneInfo.Local;
DateTime myTime = DateTime.Now;
bool isDayLight = TimeZoneInfo.Local.IsDaylightSavingTime(myTime);
if (isDayLight)
{
timezone = Math.Abs(localZone.BaseUtcOffset.Hours) + 1;
myTime = myTime.AddHours(1);
}
else
{
timezone = Math.Abs(localZone.BaseUtcOffset.Hours);
}
In above code i have given TimeZoneInfo.Local but i need to implement for all timezones.
Thanks
Prachi
Reply
Answers (
2
)
How to update date base after closing the browser?
IOT in skillset of a web developer