pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthew Kolb <muk@phaedrus.gaslightmedia.com>
To: pgsql-php@postgresql.org
Subject: Re: Unixtime function?...
Date: Wed, 2 May 2001 16:23:02 -0400
Message-ID: <20010502162301.A54232@phaedrus.gaslightmedia.com> (raw)
In-Reply-To: <5.0.2.1.0.20010502084535.0413d790@mekong.connections.yk.ca>
References: <5.0.2.1.0.20010502084535.0413d790@mekong.connections.yk.ca>

On Wed, May 02, 2001 at 08:49:32AM -0700, Richard Whittaker wrote:
> In MySQL there is a function to convert an arbitrary date/time combination 
> to a Unix timestamp, which makes it really easy to perform calculations in 
> PHP, since the result was always an integer... Is there a similar function 
> out there for PostgresSQL or PHP?...

well in php you can use date(),
http://www.php.net/manual/en/function.date.php

and all the time functions in php
http://www.php.net/manual/en/ref.datetime.php

and in postgres you can use functions like date_part()
http://www.postgresql.org/docs/aw_pgsql_book/node92.html#7786

that would be a good start.

./muk

-- 
Matthew Kolb
muk@phaedrus.gaslightmedia.com



view thread (7+ messages)  latest in thread

Message-ID: <20010502162301.A54232@phaedrus.gaslightmedia.com>
Permalink:  ../20010502162301.A54232@phaedrus.gaslightmedia.com/
Also on:    postgresql.org/message-id/20010502162301.A54232@phaedrus.gaslightmedia.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: muk@phaedrus.gaslightmedia.com
  Subject: Re: Unixtime function?...
  In-Reply-To: <20010502162301.A54232@phaedrus.gaslightmedia.com>
  References: <5.0.2.1.0.20010502084535.0413d790@mekong.connections.yk.ca> <20010502162301.A54232@phaedrus.gaslightmedia.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