Обсуждение: NEWBIE: Date format/timestamp issue ?
NEWBIE: Date format/timestamp issue ?
От
news@gemini-it.postgresql.org,
[removetoreply].com@postgresql.org (Neil Everton)
Дата:
Hi, Hopefully someone can help me without just saying RTFM ;-) I'm currently developing a system using postgres and PHP. My development system is running RH7.2 with postgres 7.1. I'm using C for the actual application and I have a field called date_received which is declared as 'timestamp'. My problem is this, when I insert records into the database timestamp seems to have a mind of it's own. Sometimes it stores the dates dd-mm-yyyy, but other times it 'seems to' store them as mm-dd-yyyy. The C command I'm using is insert into order_header (date_received) values ('dd-mm-yyyy')' Is there anyway either in postgres or in the C code to force the date format to be dd-mm-yyyy ? I've tried hardcoding dates of 31-12-2002 and 12-31-2002 and postgres just converts them (correctly) as 31st Dec 2002 both times. Ideally I'd want to force it to fixed dd-mm-yyyy and have the insert rejected as out of range. I've done several searches on the web, on this newsgroup and through a couple of books, but I'm still drawing a blank. ( I'm probably asking the wrong questions ;-) ) Any help appreciated Regards Neil E. Remove [removetoreply] from email address to mail me direct