Received: from mail4.mx.voyager.net (mail4.mx.voyager.net [216.93.66.203]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f86FYa794760 for ; Thu, 6 Sep 2001 11:34:36 -0400 (EDT) (envelope-from mvincent@cablespeed.com) Received: from mitch (216-93-124-123.mdmmi.voyager.net [216.93.124.123]) by mail4.mx.voyager.net (8.10.2/8.10.2) with SMTP id f85BUO087965; Wed, 5 Sep 2001 07:30:24 -0400 (EDT) Message-ID: <000901c136e9$31cc3170$1e51000a@mitch> From: "Mitch Vincent" To: "Brent R. Matzelle" , References: <20010906151422.84441.qmail@web13002.mail.yahoo.com> Subject: Re: Date calc/comparisions Date: Thu, 6 Sep 2001 11:32:53 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Archive-Number: 200109/4 X-Sequence-Number: 525 I generally do all my date calculations in PG, it's set of functions for time spans and such are most excellent.. Good luck! -Mitch ----- Original Message ----- From: "Brent R. Matzelle" To: Sent: Thursday, September 06, 2001 11:14 AM Subject: Re: [PHP] Date calc/comparisions > --- Mitch Vincent wrote: > > You could do > > > > SELECT EXTRACT(EPOCH FROM ); > > > > -- 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 > > Thanks for the response. Actually I found a slightly better way > of accomplishing the same thing last night. I can change the > PostgreSQL TIMESTAMP to a PHP viable Unix timestamp by > eliminating the time zone stuff from the end of the string: > > $timestamp = "2001-09-05 21:12:45-04" // simulate a PG timestamp > > // Eliminates the "-04" > $timestamp = substr($timestamp, 0, -3); > > $unix_time = strtotime($timestamp); > > // Now I can convert it: > $pretty_time = date("Y M d H:i", $unix_time); > > Regards, > > Brent > > __________________________________________________ > Do You Yahoo!? > Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger > http://im.yahoo.com > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >