Thread: Inserting the current date

Inserting the current date

From
"john"
Date:
Hi,

I have a field (Date type) and I'd like to insert the current date and time.

e.g.:

insert into my_table( my_date_field ) values ( sysdate );

Is there an equivalent to Oracle's "sysdate" keyword?

Thanks,

John



Re: Inserting the current date

From
"john"
Date:

Re: Inserting the current date

From
"john"
Date:
Nevermind, I found it here:


"john" <servobit@m.r.c> wrote in message
news:ZNwQ7.642$CR2.230891@typhoon.maine.rr.com...
> Hi,
>
> I have a field (Date type) and I'd like to insert the current date and
time.
>
> e.g.:
>
> insert into my_table( my_date_field ) values ( sysdate );
>
> Is there an equivalent to Oracle's "sysdate" keyword?
>
> Thanks,
>
> John
>
>



Re: Inserting the current date

From
Thomas Lockhart
Date:
> Is there an equivalent to Oracle's "sysdate" keyword?

  'now'

or

  date 'now'

(note single quotes; they are treated like values, not a keyword).

                  - Thomas

Re: Inserting the current date

From
wsheldah@lexmark.com
Date:

The now function will insert the current date and time:

insert into my_table( my_date_field ) values ( sysdate );

--Wes Sheldahl



"john" <servobit%www2.us.postgresql.org@interlock.lexmark.com> on 12/08/2001
05:49:29 PM

To:   pgsql-general%postgresql.org@interlock.lexmark.com
cc:    (bcc: Wesley Sheldahl/Lex/Lexmark)
Subject:  [GENERAL] Inserting the current date


Hi,

I have a field (Date type) and I'd like to insert the current date and time.

e.g.:

insert into my_table( my_date_field ) values ( sysdate );

Is there an equivalent to Oracle's "sysdate" keyword?

Thanks,

John



---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster





Re: Inserting the current date

From
Jason Earl
Date:
What exactly does sysdate do?  Is it anything like CURRENT_TIME,
CURRENT_DATE, or now()?

Jason

"john" <servobit@www2.us.postgresql.org> writes:

> Hi,
>
> I have a field (Date type) and I'd like to insert the current date and time.
>
> e.g.:
>
> insert into my_table( my_date_field ) values ( sysdate );
>
> Is there an equivalent to Oracle's "sysdate" keyword?
>
> Thanks,
>
> John
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

Re: Inserting the current date

From
Bruce Momjian
Date:
> > Is there an equivalent to Oracle's "sysdate" keyword?
>
>   'now'
>
> or
>
>   date 'now'

Isn't CURRENT_TIMESTAMP what we should be recommending?  Just checking.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: Inserting the current date

From
Thomas Lockhart
Date:
> > > Is there an equivalent to Oracle's "sysdate" keyword?
> Isn't CURRENT_TIMESTAMP what we should be recommending?  Just checking.

Yup.

                  - Thomas