pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
to_char with time
3+ messages / 3 participants
[nested] [flat]

* to_char with time
@ 2006-06-14 04:09  chester c young <chestercyoung@yahoo.com>
  0 siblings, 2 replies; 3+ messages in thread

From: chester c young @ 2006-06-14 04:09 UTC (permalink / raw)
  To: pgsql-sql

this does not work: select to_char(current_time,'HH24:MI')

what am I missing?  is it possible to format a time column in a select?

thanks,
stumped, aka, chester

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

* Re: to_char with time
@ 2006-06-14 04:27  Aaron Bono <postgresql@aranya.com>
  parent: chester c young <chestercyoung@yahoo.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Aaron Bono @ 2006-06-14 04:27 UTC (permalink / raw)
  To: chester c young <chestercyoung@yahoo.com>; +Cc: pgsql-sql

Try select to_char(now(),'HH24:MI');

-Aaron

On 6/13/06, chester c young <chestercyoung@yahoo.com> wrote:
> this does not work: select to_char(current_time,'HH24:MI')
>
> what am I missing?  is it possible to format a time column in a select?
>
> thanks,
> stumped, aka, chester



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

* Re: to_char with time
@ 2006-06-14 04:27  Phillip Smith <phillips@weatherbeeta.com.au>
  parent: chester c young <chestercyoung@yahoo.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Phillip Smith @ 2006-06-14 04:27 UTC (permalink / raw)
  To: pgsql-sql

Try using current_timestamp instead of current_time. This works for me in a
SELECT:

to_char(current_timestamp + '1 MONTH AGO', 'YYMM') as 'reference'

 

Cheers,

-p

 

-----Original Message-----
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]
On Behalf Of chester c young
Sent: Wednesday, 14 June 2006 2:10 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] to_char with time

 

this does not work: select to_char(current_time,'HH24:MI')

what am I missing?  is it possible to format a time column in a select?

thanks,
stumped, aka, chester

 __________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to
the addressee.  If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.

Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments

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


end of thread, other threads:[~2006-06-14 04:27 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-06-14 04:09 to_char with time chester c young <chestercyoung@yahoo.com>
2006-06-14 04:27 ` Aaron Bono <postgresql@aranya.com>
2006-06-14 04:27 ` Phillip Smith <phillips@weatherbeeta.com.au>

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