> I don't understand [why] it is not already in the DateTime module

Because it doesn't make a lot of sense. GMT+6 doesn't allow for daylight savings changes and any other historic changes. it requires your users to come to the site twice a year to adjust their time zone.

Instead you should offer them the list of time zones that DateTime gets from the Olson database. This is the library that every Linux distribution that I'm aware of uses. Often either using a GUI map, or a multi-step selection. Microsoft use a similar interface when selecting a time zone, and I imagine Apple use the Olson database.

- Rick



On 2016-06-27 13:59, Steve James wrote:
Thanks for your reply. I just edited my timezone.txt file (attached) that the code uses as the "guts" for the timezones select. The change seems to be working ok, but still keeping my fingers crossed...

My only point is, though, that since this such a simple thing, I don't understand what it is not already in the DateTime module. ;-(
On Sun, Jun 26, 2016 at 8:53 PM, Eric Brine <ikeg...@adaelis.com <mailto:ikeg...@adaelis.com>> wrote:

    $timezone = sprintf("%+04d", $_*100) if $timezone =~ m{^Etc/GMT(.+)};

    On Sun, Jun 26, 2016 at 11:44 PM, Steve James
    <4steveja...@gmail.com <mailto:4steveja...@gmail.com>> wrote:

        Thanks for your reply.

        My users select a timezone from a list.  I do not think that
        +0600 will be as clear as Etc/GMT+6, so it looks like I am
        going to have to do a workaround for this.  ;-(

        I think I can maybe store +0600 but show Etc/GMT+6 to the user
        (via an HTML select), but I will have to see...
        ᐧ

        On Sun, Jun 26, 2016 at 8:18 PM, Eric Brine
        <ikeg...@adaelis.com <mailto:ikeg...@adaelis.com>> wrote:

            It does, however, support "+XXXX" and "-XXXX".

            $ perl -MDateTime -E'DateTime->today(time_zone =>
            "+0600"); say "ok"'
            ok


            On Sun, Jun 26, 2016 at 11:13 PM, Steve James
            <4steveja...@gmail.com <mailto:4steveja...@gmail.com>> wrote:

                I am the principal developer for the FreeToastHost
                website system, a free website provider, content
                management system, and email list server used by over
                10,000+ Toastmasters public speaking clubs worldwide.
                Toastmasters is a non-profit and much of the labor to
                support clubs is done on a volunteer basis.
                FreeToastHost is an independent effort created by
                Toastmasters club members from open source libraries
                and via volunteer labor.  (myself included)
                FreeToastHost uses a number of your DateTime module
                functions.

                We have recently ran into an issue where it appears
                that DateTime does not support "Etc/" style names for
                timezones.  (e.g. "Etc/GMT+6")

                For example, the following produces an exception for
                me when running in a plain vanilla test script:

                          my $today = DateTime->today(time_zone =>
                    'Etc/GMT+6');


                Is there something I am missing or is this as intended?

-- /*Steve James*/
                *Linkedin: **http://www.linkedin.com/in/sejames*
-- /*Steve James*/
        PE, CPE, PMP, Six Sigma Blackbelt
        *Cell:* 818-570-1197 <tel:818-570-1197>
        *Email:* 4steveja...@gmail.com <mailto:4steveja...@gmail.com>
        *Linkedin: **http://www.linkedin.com/in/sejames*





--
/*Steve James*/
PE, CPE, PMP, Six Sigma Blackbelt
*Cell:*  818-570-1197
*Email:* 4steveja...@gmail.com <mailto:4steveja...@gmail.com>
*Linkedin: **http://www.linkedin.com/in/sejames*

Message protected for iSite by MailGuard: e-mail anti-virus, anti-spam and content filtering.
http://www.mailguard.com.au <http://www.mailguard.com.au/rm>


Report this message as spam <https://console.mailguard.com.au/ras/1OIT9zP2lP/1VQNdMWXo1JQcN65asqqqo/1.746>


--
Message  protected for iSite by MailGuard: e-mail anti-virus, anti-spam and 
content filtering.http://www.mailguard.com.au

Reply via email to