Re: localtime(0)

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Suresh Raja <suresh(dot)rajaabc(at)gmail(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: localtime(0)
Date: 2014-12-29 18:35:13
Message-ID: 54A19EE1.3090707@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 29/12/2014 17:25, Suresh Raja wrote:
> clock_timestamp() gives more than I need. i just need time, - no date,
> or msec or timezone. How can i get to print the current time alone.
>

Please don't top-post; the convention on this list is to bottom-post, as
it makes discussions easier to follow.

Depending on your needs, you could use to_char() to format the value of
clock_timestamp() as you wish. This outputs a string rather than a time
value, but would be fine for logging, say.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2014-12-29 18:56:13 Re: localtime(0)
Previous Message Tom Lane 2014-12-29 17:55:11 Re: ON_ERROR_ROLLBACK