From: | "John Christopher" <jcxxr(at)yahoo(dot)com> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Automatic date/time |
Date: | 2006-03-13 13:37:16 |
Message-ID: | dv3sid$7p0$1@sea.gmane.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Hello,
To follow up on that, how to make sure the timestamp is always stored and
displayed at, for instance, time zone 'zulu'
Something like
create table ...
{
datetime timestamptz default 'now() at time zone \'zulu\''
}
does not work; PostgreSQL complains about the syntax. Any idea.
Many thanks
JCR
"Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov> wrote in message
news:C03AC283(dot)7E86%sdavis2(at)mail(dot)nih(dot)gov(dot)(dot)(dot)
>
>
>
> On 3/13/06 6:19 AM, "Joao Miguel Ferreira" <jmf(at)estg(dot)ipvc(dot)pt> wrote:
>
>> Hello all,
>>
>> is it possible to have Pg automatically insert a Date or Time value on a
>> record if the INSERT comand does not include one ?
>>
>> Something similar to AUTO INCREMENT for INTs ?!?!
>>
>> This way the program that does the INSERT wouldn't have to worry about
>> the correct Date/Time value nor format....
>
> Look at setting defaults and set the default to something like 'now()'.
>
> Create table .... (
>
> mydate date default 'now()',
>
> );
>
> Sean
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Glaesemann | 2006-03-13 14:27:28 | Re: Automatic date/time |
Previous Message | Sean Davis | 2006-03-13 11:32:35 | Re: Automatic date/time |