June 3rd, 2003, 02:39 PM
Artist, DB Geek, Spamkiller
Join Date: Jun 2003
Location: Budapest / San Francisco
Time spent in forums: < 1 sec
Reputation Power: 0
WW bug in 7.2 to_timestamp?
I came across something really weird today (pg 7.2). Check the following:
ergodb=# -- apparent bug:
ergodb=# select to_char(current_timestamp,'WW-D-YYYY') as "right",to_char(to_timestamp(to_char(current_timestamp,'WW-D-YYYY'),'WW-D-YYYY') ,'WW-D-YYYY') as "wrong";
right | wrong
22-3-2003 | 22-4-2003
Unless I'm really overlooking something, the two functions should output exactly the same thing.
I have more or less the same problem if I use WI instead of WW.
Anybody know about this? Is it a bug? Am I stupid?
Also I'd be curious whether anyone has, off the top of their head, a better idea how to represent "the beginning of the current week."