Forum OpenACS Q&A: Response to date_add, returns "wrong" dates

Collapse
Posted by MaineBob OConnor on

Bob, why are you making it so complicated!
Great Jonathan, this works:

update jtest set 
insert_date =now()+'1 years'::interval where...
  1. As to why the wrapper doesn't work, it may be due to some date setting euro vs american dates???
  2. I'm using: psql 7.1.2

  3. You say, "(and yes, 12-31 + 1 month = 1-31 not 1-30)"
    And is this correct?: 12-31 + 2 month = 2-31 Hmmmm. or 3-3

  4. And this does not work:
    update jtest set 
    insert_date =insert_date +'20000 epoch'::interval where...
    ERROR: Bad interval external representation '20000 epoch'

    -Bob