Thread

  1. timespan weirdness (fwd)

    Marin D <marin@cybernet.bg> — 1998-06-02T07:36:58Z

    
    Hi!
    
    I need some help on the following timspan results:
    
    create table test(d date);
    insert into test values('1-5-98');	// European format
    
    test=> select * from test;
             d
    ----------
    01-05-1998
    (1 row)
    
    
    // this is OK
    
    test=> select date(datetime(d) + '1 month'::timespan) from test;
          date
    ----------
    01-06-1998
    (1 row)
    
    
    // this is OK
    
    test=> select date(datetime(d) + '5 months'::timespan) from test;
          date
    ----------
    01-10-1998
    (1 row)
    
    
    // Ooops!
    
    test=> select date (datetime(d) + '6 months'::timespan) from test;
          date
    ----------
    31-10-1998
    (1 row)
    
    
    // Ok too...
    
    test=> select date (datetime(d) + '13 months'::timespan) from test;
          date
    ----------
    01-06-1999
    (1 row)
    
    
    Any comments?
    
    Than for your help!
    
    	Marin
    
    
    
              -= Why do we need gates in a world without fences? =-