date_format in postresql
am 21.07.2004 02:55:03 von azah azah
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-
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Re: date_format in postresql
am 21.07.2004 03:45:29 von Christopher Kings-Lynne
> what the format query in postresql? Anyone who can help me?
http://www.postgresql.org/docs/7.4/static/functions-formatti ng.html
Chris
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Re: date_format in postresql
am 21.07.2004 04:39:38 von pg
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-formatti ng.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
Re: date_format in postresql
am 21.07.2004 05:53:14 von izza76
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 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-formatti ng.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
>
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Re: date_format in postresql
am 21.07.2004 15:17:45 von fbax
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 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-formatti ng.html
> >
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Re: date_format in postresql
am 21.07.2004 16:45:27 von pg
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 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-formatti ng.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
> >
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
Re: date_format in postresql
am 22.07.2004 05:13:03 von izza76
Hi all,
Successful solved.
I'm just using to_timestamp function.
Thanks
On Wed, 21 Jul 2004 10:45:27 -0400, Rod Taylor 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 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-formatti ng.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
> > >
>
>
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org