MST/MDT timezones
MST/MDT timezones
Do my eyes deceive me or do I *still* have to manually put the store in/out of daylight savings time? I'm running GOLD build 7345.
Re: MST/MDT timezones
Yes because the feature has not been requested, and not all countries and states participate so trying to do any time adjustments automatically may be problematic.
You are welcome to request the feature by clicking the green Feedback button.
You are welcome to request the feature by clicking the green Feedback button.
Thank you for choosing AbleCommerce!
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
- NC Software
- AbleCommerce Partner
- Posts: 4620
- Joined: Mon Sep 13, 2004 6:06 pm
- Contact:
Re: MST/MDT timezones
Oh yes it has
Long long ago and many times in other forums. Logan is well aware. The reasoning I "believe" was a .NET framework issue but with .NET 4 and later support it "should" be implemented. I think the AC site is the only one that doesn't have this functionality, even lesser PHP sites have it.

Neal Culiner
NC Software, Inc.
NC Software, Inc.
-
- Commodore (COMO)
- Posts: 436
- Joined: Tue May 07, 2013 1:59 pm
Re: MST/MDT timezones
I put this in my user and admin login page's Page_Init methods:
Our site is member only, so this way before anyone does anything, the time will be adjusted if necessary. I'm sure the actual time zone and offset could be extracted from .Net instead of hard-coded. Another way to do it would be to use a timer in Global.asax, like AC does for the Google Feed generation.
Code: Select all
CommerceBuilder.Stores.StoreSettingsManager settings = CommerceBuilder.Common.AbleContext.Current.Store.Settings;
bool isDaylight = DateTime.Now.IsDaylightSavingTime();
if (isDaylight && settings.TimeZoneCode != "CDT")
{
settings.TimeZoneCode = "CDT";
settings.TimeZoneOffset = -5.0;
settings.Save();
}
else
{
if (!isDaylight && settings.TimeZoneCode != "CST")
{
settings.TimeZoneCode = "CST";
settings.TimeZoneOffset = -6.0;
settings.Save();
}
}
Jay
- NC Software
- AbleCommerce Partner
- Posts: 4620
- Joined: Mon Sep 13, 2004 6:06 pm
- Contact:
Re: MST/MDT timezones
It only affects Admin data "viewing" AFAIK so it could be processed on access to /admin
Neal Culiner
NC Software, Inc.
NC Software, Inc.
-
- Commodore (COMO)
- Posts: 436
- Joined: Tue May 07, 2013 1:59 pm