I need to get real DateTime by CultureInfo object. For example, my site is on US company server (that has own US time) but site is for Italy (example), where time is different, and on the site I should show Italy time, not US. In web.congig I have currentCulture=”it-It”
Is it possible to get time for site and if so, what is the right way to do it?
Actually it would be great to have a function like:
public static DateTime GetSiteDate(CultureInfo ci)
{
....
return siteDate;
}
Thanks!
It is likely not possible to get the local time based on culture alone, mostly because time zones don’t correspond one-to-one to countries. While Italy’s time zone is Central European Standard Time (if I’m not mistaken), it will not always be the case that each country has a single time zone. For example, in the United States there are at least four time zones.