Re: change year in timestamp

From: brew(at)theMode(dot)com
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: change year in timestamp
Date: 2003-02-14 17:37:50
Message-ID: Pine.BSF.4.44.0302141221470.83942-100000@themode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


argo......

> How can i change the year in a timestamp ?=20
> F.e from 2019-06-11 19:38:29+03 to 2003-06-11 19:38:29+03

Looks similiar to a problem I had, moving classified expirations nearer in
time to get them out of the database. (I send emails to the users telling
them of the pending expiration of their listing).

While I could have certainly have written a perl script to parse out the
timestamp components and reassemble them again what I did was update all
the rows posted a certain month from years past that expire way in the
future and move them all to expire on a date in the near future. I moved
them month by month to expire on different days in the near future.

Of course I could do that because I have both date_posted and date_expire
timestamps for each record.

Maybe some of the SQL gurus here can tell us an even easier way.

brew

==========================================================================
Strange Brew (brew(at)theMode(dot)com)
Check out my Musician's Online Database Exchange (The MODE Pages)
http://www.TheMode.com
==========================================================================

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2003-02-14 17:42:54 Re: Executing SQL commands in script files
Previous Message greg 2003-02-14 16:21:30 Re: change year in timestamp