From: | Richard Harley <richard(at)scholarpack(dot)com> |
---|---|
To: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Selecting timestamp from Database |
Date: | 2013-04-08 13:22:25 |
Message-ID: | 9195DB37-090B-4772-A36C-144BA67E09FA@scholarpack.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
This doesn't seem to work - take a normal GMT date for example: 2012/12/14 12:02:45 GMT
select timestamp from attendance where timestamp = '2012/12/14 12:02:45'
..returns nothing
On 8 Apr 2013, at 14:17, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> wrote:
> On 04/08/2013 06:03 AM, Richard Harley wrote:
>> Hello all
>>
>> Pretty sure this should be simple - how can I select a timestamp from a
>> database?
>>
>> The timestamp is stored in the db like this:
>>
>> 2013/04/08 13:54:41 GMT+1
>>
>>
>> How can I select based on that timestamp?
>>
>> At the simplest level "select timestamp from attendance where timestamp
>> = '2013/04/08 13:54:41 GMT+1'"
>>
>> ..doesn't obviously work but I've tried all sorts of to_char and
>> to_timestamp combos to no avail..
>>
>> Any ideas?
>
> select timestamp from attendance where timestamp = '2013/04/08 13:54:41+1'
>
>>
>> Cheers
>> Rich
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)gmail(dot)com
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2013-04-08 13:25:12 | Re: Selecting timestamp from Database |
Previous Message | Adrian Klaver | 2013-04-08 13:17:36 | Re: Selecting timestamp from Database |