Re: Timestamp comparison with string in some special cases

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Timestamp comparison with string in some special cases
Date: 2007-11-19 16:15:02
Message-ID: 20071119161502.GN1955@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Nov 19, 2007 at 04:52:10PM +0100, Dragan Matic wrote:
> select * from table where timestamp_column < '11/19/2007 15:46:09 PM'

Maybe the to_timestamp() function would help you:

SELECT to_timestamp('11/19/2007 15:46:09 PM','MM/DD/YYYY HH24:MI:SS')
-> 2007-11-19 15:46:09+00

That just ignores the AM/PM flag, which may or may not be what you want
to do.

Sam

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Josh Harrison 2007-11-19 16:15:08 Postgresql storage question
Previous Message Ian Barwick 2007-11-19 16:08:32 Re: IP addresses