Re: Porting from mysql to psql (UNIX_TIMESTAMP()?)

From: "Rommel B(dot) Abaya" <rommel(dot)abaya(at)ramcargroup(dot)com>
To: zlatko(at)iskon(dot)hr
Cc: pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: Porting from mysql to psql (UNIX_TIMESTAMP()?)
Date: 2000-09-09 11:25:59
Message-ID: 39BA1E47.94398377@ramcargroup.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

i thick it's epoch() in PostgreSQL....check your documentation.

Zlatko Calusic wrote:

> Hi!
>
> As subject says, we are currently porting all of our data, programs
> and logic from mysql to postgresql. One of the things we have yet to
> resolve is how to replace mysql's UNIX_TIMESTAMP() function we used
> extensively in PosgreSQL?
>
> Function works like this in mysql:
>
> mysql> select start from connection limit 1;
> +---------------------+
> | start |
> +---------------------+
> | 2000-07-03 20:12:37 |
> +---------------------+
> 1 row in set (0.01 sec)
>
> mysql> select UNIX_TIMESTAMP(start) from connection limit 1;
> +-----------------------+
> | UNIX_TIMESTAMP(start) |
> +-----------------------+
> | 962647957 |
> +-----------------------+
> 1 row in set (0.00 sec)
>
> Is there any similar functionality (returning unixish number of
> seconds since 1970 from the timestamp field) in PostgreSQL?
>
> I tried all of the available date/time functions, type casting but all
> to no avail.
>
> TIA,
> --
> Zlatko
>
> P.S Is it bad manners crossposting to two pgsql mailing list? Still
> new to PostgreSQL, still learning...

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gisle Dankel 2000-09-09 11:47:33 List of error messages
Previous Message Zlatko Calusic 2000-09-09 11:02:39 Porting from mysql to psql (UNIX_TIMESTAMP()?)

Browse pgsql-sql by date

  From Date Subject
Next Message Zlatko Calusic 2000-09-09 12:30:35 Re: Porting from mysql to psql (UNIX_TIMESTAMP()?)
Previous Message Zlatko Calusic 2000-09-09 11:02:39 Porting from mysql to psql (UNIX_TIMESTAMP()?)