pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
date_format in postresql
7+ messages / 4 participants
[nested] [flat]

* date_format in postresql
@ 2004-07-21 00:55  azah azah <izza76@gmail.com>
  0 siblings, 2 replies; 7+ messages in thread

From: azah azah @ 2004-07-21 00:55 UTC (permalink / raw)
  To: pgsql-sql; pgsql-php@postgresql.org

Hi,
I want convert from mysql to postresql,
in mysql, query to database using the code as below:

date_format(submittime, "%W %M %e, %Y - %r")

what the format query in postresql? Anyone who can help me?

Thanks 
-Azah-



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: date_format in postresql
@ 2004-07-21 01:45  Christopher Kings-Lynne <chriskl@familyhealth.com.au>
  parent: azah azah <izza76@gmail.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Christopher Kings-Lynne @ 2004-07-21 01:45 UTC (permalink / raw)
  To: azah azah <izza76@gmail.com>; +Cc: pgsql-sql; pgsql-php@postgresql.org

> what the format query in postresql? Anyone who can help me?

http://www.postgresql.org/docs/7.4/static/functions-formatting.html

Chris




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: date_format in postresql
@ 2004-07-21 02:39  Rod Taylor <pg@rbt.ca>
  parent: azah azah <izza76@gmail.com>
  1 sibling, 2 replies; 7+ messages in thread

From: Rod Taylor @ 2004-07-21 02:39 UTC (permalink / raw)
  To: azah azah <izza76@gmail.com>; +Cc: pgsql-sql

On Tue, 2004-07-20 at 20:55, azah azah wrote:
> Hi,
> I want convert from mysql to postresql,
> in mysql, query to database using the code as below:
> 
> date_format(submittime, "%W %M %e, %Y - %r")

to_char(submittime, 'format string')

http://www.postgresql.org/docs/7.4/static/functions-formatting.html





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: date_format in postresql
@ 2004-07-21 03:53  azah azah <izza76@gmail.com>
  parent: Rod Taylor <pg@rbt.ca>
  1 sibling, 1 reply; 7+ messages in thread

From: azah azah @ 2004-07-21 03:53 UTC (permalink / raw)
  To: Rod Taylor <pg@rbt.ca>; +Cc: pgsql-sql

Thanks Chris and Rod.

I think I have a problem because not many function existing in
postresql that i installed.
How can i get all the build-in functions because the basic function
to_char is not existing in the database?

On Tue, 20 Jul 2004 22:39:38 -0400, Rod Taylor <pg@rbt.ca> wrote:
> On Tue, 2004-07-20 at 20:55, azah azah wrote:
> > Hi,
> > I want convert from mysql to postresql,
> > in mysql, query to database using the code as below:
> >
> > date_format(submittime, "%W %M %e, %Y - %r")
> 
> to_char(submittime, 'format string')
> 
> http://www.postgresql.org/docs/7.4/static/functions-formatting.html
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match
>



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: date_format in postresql
@ 2004-07-21 13:17  Frank Bax <fbax@sympatico.ca>
  parent: Rod Taylor <pg@rbt.ca>
  1 sibling, 0 replies; 7+ messages in thread

From: Frank Bax @ 2004-07-21 13:17 UTC (permalink / raw)
  To: pgsql-sql

Check your version with:
         select version();
In the meantime, you could try
         date_part('epoch', submittime)
which will return a unix timestamp, you could then use functions within 
your scripting language to convert to human readable date formats.

Frank

At 11:53 PM 7/20/04, azah azah wrote:

>Thanks Chris and Rod.
>
>I think I have a problem because not many function existing in
>postresql that i installed.
>How can i get all the build-in functions because the basic function
>to_char is not existing in the database?
>
>On Tue, 20 Jul 2004 22:39:38 -0400, Rod Taylor <pg@rbt.ca> wrote:
> > On Tue, 2004-07-20 at 20:55, azah azah wrote:
> > > Hi,
> > > I want convert from mysql to postresql,
> > > in mysql, query to database using the code as below:
> > >
> > > date_format(submittime, "%W %M %e, %Y - %r")
> >
> > to_char(submittime, 'format string')
> >
> > http://www.postgresql.org/docs/7.4/static/functions-formatting.html
> >




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: date_format in postresql
@ 2004-07-21 14:45  Rod Taylor <pg@rbt.ca>
  parent: azah azah <izza76@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Rod Taylor @ 2004-07-21 14:45 UTC (permalink / raw)
  To: azah azah <izza76@gmail.com>; +Cc: pgsql-sql

On Tue, 2004-07-20 at 23:53, azah azah wrote:
> Thanks Chris and Rod.
> 
> I think I have a problem because not many function existing in
> postresql that i installed.
> How can i get all the build-in functions because the basic function
> to_char is not existing in the database?

Which version of PostgreSQL are you using?

select version();

> On Tue, 20 Jul 2004 22:39:38 -0400, Rod Taylor <pg@rbt.ca> wrote:
> > On Tue, 2004-07-20 at 20:55, azah azah wrote:
> > > Hi,
> > > I want convert from mysql to postresql,
> > > in mysql, query to database using the code as below:
> > >
> > > date_format(submittime, "%W %M %e, %Y - %r")
> > 
> > to_char(submittime, 'format string')
> > 
> > http://www.postgresql.org/docs/7.4/static/functions-formatting.html
> > 
> > 
> > ---------------------------(end of broadcast)---------------------------
> > TIP 9: the planner will ignore your desire to choose an index scan if your
> >       joining column's datatypes do not match
> >




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: date_format in postresql
@ 2004-07-22 03:13  azah azah <izza76@gmail.com>
  parent: Rod Taylor <pg@rbt.ca>
  0 siblings, 0 replies; 7+ messages in thread

From: azah azah @ 2004-07-22 03:13 UTC (permalink / raw)
  To: Rod Taylor <pg@rbt.ca>; +Cc: pgsql-sql

Hi all, 
Successful solved.
I'm just using to_timestamp function.

Thanks

On Wed, 21 Jul 2004 10:45:27 -0400, Rod Taylor <pg@rbt.ca> wrote:
> On Tue, 2004-07-20 at 23:53, azah azah wrote:
> > Thanks Chris and Rod.
> >
> > I think I have a problem because not many function existing in
> > postresql that i installed.
> > How can i get all the build-in functions because the basic function
> > to_char is not existing in the database?
> 
> Which version of PostgreSQL are you using?
> 
> select version();
> 
> 
> 
> > On Tue, 20 Jul 2004 22:39:38 -0400, Rod Taylor <pg@rbt.ca> wrote:
> > > On Tue, 2004-07-20 at 20:55, azah azah wrote:
> > > > Hi,
> > > > I want convert from mysql to postresql,
> > > > in mysql, query to database using the code as below:
> > > >
> > > > date_format(submittime, "%W %M %e, %Y - %r")
> > >
> > > to_char(submittime, 'format string')
> > >
> > > http://www.postgresql.org/docs/7.4/static/functions-formatting.html
> > >
> > >
> > > ---------------------------(end of broadcast)---------------------------
> > > TIP 9: the planner will ignore your desire to choose an index scan if your
> > >       joining column's datatypes do not match
> > >
> 
>



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2004-07-22 03:13 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-21 00:55 date_format in postresql azah azah <izza76@gmail.com>
2004-07-21 01:45 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2004-07-21 02:39 ` Rod Taylor <pg@rbt.ca>
2004-07-21 03:53   ` azah azah <izza76@gmail.com>
2004-07-21 14:45     ` Rod Taylor <pg@rbt.ca>
2004-07-22 03:13       ` azah azah <izza76@gmail.com>
2004-07-21 13:17   ` Frank Bax <fbax@sympatico.ca>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox