pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mitch Vincent <mvincent@cablespeed.com>
To: Chris Ruprecht <chrup999@yahoo.com>
To: p-php <pgsql-php@postgresql.org>
Subject: Re: Date Manipulations
Date: Wed, 11 Jul 2001 12:39:32 -0400
Message-ID: <000d01c10a28$13ac67c0$1a0d040a@Mitch> (raw)
References: <002101c10a12$bea29660$5dd26383@corp.compucom.com>

Well, it depends on what you're trying to do :-)

You can add days an arbitrary date in a number of ways , I often let PG
handle it though (as you are)..

I generally do something like

SELECT ('05-05-2001'::date + '5 days'::interval)

Or something like that if I need X days ahead or behind date Y...

----- Original Message -----
From: "Chris Ruprecht" <chrup999@yahoo.com>
To: "p-php" <pgsql-php@postgresql.org>
Sent: Wednesday, July 11, 2001 10:06 AM
Subject: [PHP] Date Manipulations


> Hi all,
>
> Currently, when working with dates, I use constructs like
>
> ('$NewDate'::date + 5)::date
>
> this seems a little clumsy to me and I was wondering if there was an
easier
> way of doing this.
>
> Best regards,
> Chris
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>




view thread (3+ messages)  latest in thread

Message-ID: <000d01c10a28$13ac67c0$1a0d040a@Mitch>
Permalink:  ../000d01c10a28$13ac67c0$1a0d040a@Mitch/
Also on:    postgresql.org/message-id/000d01c10a28$13ac67c0$1a0d040a@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, chrup999@yahoo.com
  Subject: Re: Date Manipulations
  In-Reply-To: <000d01c10a28$13ac67c0$1a0d040a@Mitch>
  References: <002101c10a12$bea29660$5dd26383@corp.compucom.com> <000d01c10a28$13ac67c0$1a0d040a@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