Thread: to_char with time

to_char with time

From
chester c young
Date:
this does not work: select to_char(current_time,'HH24:MI')<br /><br />what am I missing?  is it possible to format a
timecolumn in a select?<br /><br />thanks,<br />stumped, aka, chester<br /><p>
__________________________________________________<br/>Do You Yahoo!?<br />Tired of spam? Yahoo! Mail has the best spam
protectionaround <br />http://mail.yahoo.com  

Re: to_char with time

From
"Aaron Bono"
Date:
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


Re: to_char with time

From
"Phillip Smith"
Date:
<div class="Section1"><p class="MsoNormal"><font color="navy" face="Arial" size="2"><span style="font-size:
10.0pt;font-family:Arial;color:navy">Try using current_timestamp instead of current_time. This works for me in a
SELECT:</span></font><pclass="MsoNormal" style="text-indent:36.0pt"><font color="navy" face="Courier New"
size="2"><spanstyle="font-size:10.0pt;font-family:"Courier New"; 
color:navy">to_char(current_timestamp + '1 MONTH AGO', 'YYMM') as ‘reference’</span></font><p class="MsoNormal"><font
color="navy"face="Arial" size="2"><span style="font-size: 
10.0pt;font-family:Arial;color:navy"> </span></font><p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
style="font-size:
10.0pt;font-family:Arial;color:navy">Cheers,</span></font><p class="MsoNormal"><font color="navy" face="Arial"
size="2"><spanstyle="font-size: 
10.0pt;font-family:Arial;color:navy">-p</span></font><p class="MsoNormal"><font color="navy" face="Arial"
size="2"><spanstyle="font-size: 
10.0pt;font-family:Arial;color:navy"> </span></font><p class="MsoNormal" style="margin-left:36.0pt"><font face="Tahoma"
size="2"><spanlang="EN-US" style="font-size:10.0pt;font-family:Tahoma">-----Original Message-----<br /><b><span
style="font-weight:bold">From:</span></b>pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]
<b><spanstyle="font-weight:bold">On Behalf Of </span></b></span></font><font face="Tahoma" size="2"><span lang="EN-US"
style="font-size:10.0pt;font-family:Tahoma">chester</span></font><fontface="Tahoma" size="2"><span lang="EN-US"
style="font-size:10.0pt;font-family:Tahoma">c young<br /><b><span style="font-weight:bold">Sent:</span></b>
</span></font><fontface="Tahoma" size="2"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma">Wednesday, 14
June2006</span></font><font face="Tahoma" size="2"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma">
</span></font><fontface="Tahoma" size="2"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma">2:10
PM</span></font><fontface="Tahoma" size="2"><span lang="EN-US" style="font-size: 
10.0pt;font-family:Tahoma"><br /><b><span style="font-weight:bold">To:</span></b> pgsql-sql@postgresql.org<br
/><b><spanstyle="font-weight:bold">Subject:</span></b> [SQL] to_char with time</span></font><p class="MsoNormal"
style="margin-left:36.0pt"><fontface="Times New Roman" size="3"><span style="font-size:12.0pt"> </span></font><p
class="MsoNormal"style="margin-left:36.0pt"><font face="Times New Roman" size="3"><span style="font-size:12.0pt">this
doesnot work: select to_char(current_time,'HH24:MI')<br /><br /> what am I missing?  is it possible to format a time
columnin a select?<br /><br /> thanks,<br /> stumped, aka, </span></font>chester<p style="margin-left:36.0pt"><font
face="TimesNew Roman" size="3"><span style="font-size:12.0pt"> __________________________________________________<br />
DoYou Yahoo!?<br /> Tired of spam? Yahoo! Mail has the best spam protection around <br /> http://mail.yahoo.com
</span></font></div><br/><p><b>*******************Confidentiality and Privilege Notice*******************</b><p> The
materialcontained in this message is privileged and confidential to the addressee. If you are not the addressee
indicatedin this message or responsible for delivery of the message to such person, you may not copy or deliver this
messageto anyone, and you should destroy it and kindly notify the sender by reply email. <p> Information in this
messagethat 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
consequentialloss arising from transmission of this message or any attachments <br />