CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Posts
    1

    Strange behaviour of RWTime class

    I have one doubt about RogueWave's RWTime Class ....

    I am seeing some strange results when I am trying to find out when the DST starts and ends on different years.
    I am using HPUX Itanium m/c and the time zone I am using is MET-1METDST.

    This is the program which I am running on my HPUX Itanium m/c :
    -------------------------------------------------------------------
    #include <rw/rwtime.h>
    #include <rw/rwdate.h>
    #include <rw/rstream.h>

    int main(){
    RWTime d1(RWTime::beginDST(2008, RWZone::local()));
    std::cout << "Start of DST, 2008: " << d1 << std::endl;
    RWTime d2(RWTime::endDST(2008, RWZone::local()));
    std::cout << "End of DST, 2008: " << d2 << std::endl;

    RWTime d3(RWTime::beginDST(2009, RWZone::local()));
    std::cout << "Start of DST, 2009: " << d3 << std::endl;
    RWTime d4(RWTime::endDST(2009, RWZone::local()));
    std::cout << "End of DST, 2009: " << d4 << std::endl;

    RWTime d5(RWTime::beginDST(2010, RWZone::local()));
    std::cout << "Start of DST, 2010: " << d5 << std::endl;
    RWTime d6(RWTime::endDST(2010, RWZone::local()));
    std::cout << "End of DST, 2010: " << d6 << std::endl;

    RWTime d7(RWTime::beginDST(2011, RWZone::local()));
    std::cout << "Start of DST, 2011: " << d7 << std::endl;
    RWTime d8(RWTime::endDST(2011, RWZone::local()));
    std::cout << "End of DST, 2011: " << d8 << std::endl;

    RWTime d9(RWTime::beginDST(2012, RWZone::local()));
    std::cout << "Start of DST, 2012: " << d9 << std::endl;
    RWTime d10(RWTime::endDST(2012, RWZone::local()));
    std::cout << "End of DST, 2012: " << d10 << std::endl;

    return 0;
    }
    --------------------------------------------------------

    and the output is
    ---------------------------------
    Start of DST, 2008: 03/28/08 03:00:00
    End of DST, 2008: 10/31/08 02:00:00
    Start of DST, 2009: 03/28/09 03:00:00
    End of DST, 2009: 10/31/09 02:00:00
    Start of DST, 2010: 03/28/10 03:00:00
    End of DST, 2010: 10/31/10 02:00:00
    Start of DST, 2011: 03/28/11 03:00:00
    End of DST, 2011: 10/31/11 02:00:00
    Start of DST, 2012: 03/28/12 03:00:00
    End of DST, 2012: 10/31/12 02:00:00
    ---------------------------------------------
    Note : Current calander year of the underlyng OS is 2010.

    I have observed that output is showing the DST Start date and end date of the year 2010 even if I a pass
    the year as 2008 or 2009 or 2011 or 2012.


    I am using HP-UX IA [11.31] system and the TimeZone is MET-1METDST.

    Could you please help me in this regard as soon as possible ?

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Strange behaviour of RWTime class

    Why not contact tech support at RogueWave? What does RogueWave say about this issue?

    Regards,

    Paul McKenzie

  3. #3
    Join Date
    Apr 2005
    Posts
    107

    Re: Strange behaviour of RWTime class

    Remember, that in the US, DST Start/End has become completely arbitrary, and at the mercy of the "Career Politicians" in DC primarily, and the "Career Politicians" locally in some few cases, where it used to be a fixed, deterministic day.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured