Date format problems

From: "Mark Roberts" <RoberM1(at)gosh(dot)nhs(dot)uk>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Date format problems
Date: 2004-02-16 13:06:22
Message-ID: s030c05a.023@smtp.gosh.nhs.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Hi im using the function below to insert data into my db; im using
now() to get the timestamptz, however when inserted in the db the format
seems to vary, the majority of the time its in the required European
style but does spontaniously change to various other type can anyone
throw any light on this problem.

Further info:
DATESTYLE is currently set to European.
db table type is 'timestamptz'

#######################################################################################

CREATE FUNCTION newmess(int4, text, varchar) RETURNS varchar AS '
DECLARE
userid ALIAS for $1;
message ALIAS for $2;
touser ALIAS for $3;
enttime DATETIME;
touserid INTEGER;
rdset BIT;
from VARCHAR;

BEGIN
rdset = 0;
touserid=(select id from users where lastname=touser);
enttime=(select now());
from=(select lastname from users where id = userid);
INSERT INTO CallLog.message(message, fromuser, touser, txtime, rd,
fromusern) values(message. userid, touserid, enttime, rdset, from);
END;
' LANGUAGE 'plpgsql';

*********************************************************************************************************************

Im getting desperate, please help if you can, and thx to those that
replied to my previous mail.

Many Thanks in advance,

Kind Regards, Mark.

_______________________________________
Disclaimer: Great Ormond Street Hospital for Children NHS Trust

SECURITY WARNING RE: PATIENT OR OTHER CONFIDENTIAL DATA. Please note
that Internet E-mail is simply not a secure communication medium.
We strongly advise that you understand & observe this lack of security
when e-mailing us.

This email and any files transmitted with it are intended solely for
the use of the individual to whom they are addressed. If you have
received this email in error please notify your email administrator.

Any views or opinions are solely those of the author of this email
and do not represent those of Great Ormond Street Hospital for
Children NHS Trust unless specifically stated.

VIRUSES: This email message has been checked for the presence of
computer viruses by Sophos antivirus software. However, this does
not guarantee that this email is free of viruses, and the recipient
should perform their own check.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message sad 2004-02-16 13:08:52 Re: Getting the week of a date
Previous Message Richard Huxton 2004-02-16 13:03:12 Re: Getting the week of a date