MST/MDT timezones

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
HaggisMan
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Tue Aug 17, 2010 2:41 pm

MST/MDT timezones

Post by HaggisMan » Tue Aug 05, 2014 10:28 am

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.

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: MST/MDT timezones

Post by Katie » Tue Aug 05, 2014 3:29 pm

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.
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
NC Software
AbleCommerce Partner
AbleCommerce Partner
Posts: 4620
Joined: Mon Sep 13, 2004 6:06 pm
Contact:

Re: MST/MDT timezones

Post by NC Software » Wed Aug 06, 2014 6:18 am

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.

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

Re: MST/MDT timezones

Post by jguengerich » Fri Aug 08, 2014 6:20 am

I put this in my user and admin login page's Page_Init methods:

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();
                }
            }
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.
Jay

User avatar
NC Software
AbleCommerce Partner
AbleCommerce Partner
Posts: 4620
Joined: Mon Sep 13, 2004 6:06 pm
Contact:

Re: MST/MDT timezones

Post by NC Software » Fri Aug 08, 2014 6:25 am

It only affects Admin data "viewing" AFAIK so it could be processed on access to /admin
Neal Culiner
NC Software, Inc.

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

Re: MST/MDT timezones

Post by jguengerich » Fri Aug 08, 2014 6:34 am

I think you're right, but I wasn't 100% sure, so I did both just in case.
Jay

Post Reply