pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amitanand Chikorde <amit99rs@gmail.com>
To: pgsql-sql@postgresql.org
Subject: EPOCH TIMESTAMP Conversion Problem
Date: Wed, 7 Nov 2007 16:07:05 +0530
Message-ID: <7e7750290711070237x7da14616i383ace7f513f0882@mail.gmail.com> (raw)

hi all,

    I have a table 'myTable'.
    There is an attribute  in the table as,


Column      |            Type             | Modifiers
-----------------+-----------------------------+-----------
 mydate     | timestamp without time zone | not null


I want to convert MAX(mydate) from myTable to Epoch.


SELECT EXTRACT(EPOCH FROM TIMESTAMP WITHOUT TIME ZONE '2007-11-01
17:42:01.81693') ::int4;


How the above query can be used to convert MAX(mydate) to EPoch value?
Is there any other query that I can use?
I think it is not worth to write a function/procedure to just replace
the value in a query?

     Please HELP...................

Thanks in advance


-- 
Amitanand N. Chikorde.
Software Engineer
==================================
cat /dev/zero >/dev/null
==================================



view thread (5+ messages)  latest in thread

Message-ID: <7e7750290711070237x7da14616i383ace7f513f0882@mail.gmail.com>
Permalink:  ../7e7750290711070237x7da14616i383ace7f513f0882@mail.gmail.com/
Also on:    postgresql.org/message-id/7e7750290711070237x7da14616i383ace7f513f0882@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: amit99rs@gmail.com
  Subject: Re: EPOCH TIMESTAMP Conversion Problem
  In-Reply-To: <7e7750290711070237x7da14616i383ace7f513f0882@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox