Re: Formatting current_time output

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Formatting current_time output
Дата
Msg-id web-1770248@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на Formatting current_time output  (Thomas Good <tomg@sqlclinic.net>)
Ответы Re: Formatting current_time output  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
Re: Formatting current_time output  (Thomas Good <tomg@sqlclinic.net>)
Список pgsql-sql
Thomas,

> SELECT TO_CHAR(SYSDATE,'HH:MI AM') FROM DUAL; -- Oracle
> SELECT TIME_FORMAT(current_time,'%l:%i %p');  -- MySQL
> 
> Returned:   10:58 AM
> 
> I've found lpad(current_time,5); which gets me 1/3 of the way.
> Is there a function I haven't found?

Um, what's wrong with:
SELECT to_char(current_time, 'HH12:MI AM');
?

(See "Formatting Functions" under "Functions and Operators" in the
User's Guide)

-Josh Berkus



В списке pgsql-sql по дате отправления:

Предыдущее
От: Roberto Mello
Дата:
Сообщение: epoch to date
Следующее
От: Achilleus Mantzios
Дата:
Сообщение: Re: Formatting current_time output