pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mitch Vincent <mvincent@cablespeed.com>
To: pgsql-php@postgresql.org
To: Brent R. Matzelle <bmatzelle@yahoo.com>
Subject: Re: Date calc/comparisions
Date: Thu, 6 Sep 2001 00:01:50 -0400
Message-ID: <003d01c13688$be7c8bd0$f8165dd8@mitch> (raw)
References: <AQUARIUSgC81TbdkSmL00000009@aquarius.asdev.activestrategy.com>

You could do

SELECT EXTRACT(EPOCH FROM <timestamp>);

-- To get epoch, then use PHP to do the date calculation.. You could do the
calculation in the database too, though..

Check out
http://postgresql.crimelabs.net/users-lounge/docs/7.1/user/functions-datetim
e.html

----- Original Message -----
From: "Brent R. Matzelle" <bmatzelle@yahoo.com>
To: <pgsql-php@postgresql.org>
Sent: Wednesday, September 05, 2001 1:24 PM
Subject: [PHP] Date calc/comparisions


> I need to know if the date returned from a TIMESTAMP field is less than 24
hours old.
> However, PHP does not understand how to compare times retrieved from
PostgreSQL.
> Have any of you any experience with this type of calculation?
>
> Thanks and warm regards,
>
> Brent
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>




view thread (4+ messages)  latest in thread

Message-ID: <003d01c13688$be7c8bd0$f8165dd8@mitch>
Permalink:  ../003d01c13688$be7c8bd0$f8165dd8@mitch/
Also on:    postgresql.org/message-id/003d01c13688$be7c8bd0$f8165dd8@mitch

 · 

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: mvincent@cablespeed.com, bmatzelle@yahoo.com
  Subject: Re: Date calc/comparisions
  In-Reply-To: <003d01c13688$be7c8bd0$f8165dd8@mitch>
  References: <AQUARIUSgC81TbdkSmL00000009@aquarius.asdev.activestrategy.com> <003d01c13688$be7c8bd0$f8165dd8@mitch>

* 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