Received: from newman.hartehanks.com (newman.hartehanks.com [204.89.158.3]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0TFKXq97209 for ; Mon, 29 Jan 2001 10:20:33 -0500 (EST) (envelope-from Timothy_Maguire@hartehanks.com) Received: from linmail.hartehanks.com (unverified) by newman.hartehanks.com (Content Technologies SMTPRS 4.1.5) with ESMTP id ; Mon, 29 Jan 2001 10:12:19 -0500 Subject: Re: strtotime() and postgresql date/time output To: Rien Broekstra Cc: pgsql-php@postgresql.org From: Timothy_Maguire@hartehanks.com Date: Mon, 29 Jan 2001 10:14:47 -0500 Message-ID: X-MIMETrack: Serialize by Router on linmail/Harte-Hanks(Release 5.0.5 |September 22, 2000) at 01/29/2001 10:14:47 AM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Archive-Number: 200101/74 X-Sequence-Number: 139 When I pull a timestamp from a db, i use the to_char () postgresql function. This is real nice because you can convert the months into words (Jan or January). Try something like this: SELECT to_char(timestamp_field, "M") from table; I forget the exact syntax, but you can find it at postgresql.org under the users guide. TIm. Rien Broekstra @postgresql.org on 01/27/2001 06:39:42 AM Sent by: pgsql-php-owner@postgresql.org To: pgsql-php@postgresql.org cc: Subject: strtotime() and postgresql date/time output I have the following problem I want to save timestamps in a database and use them in a php script. According to the documentation, postgres's date/time output is possible in 4 styles. My problem is that the php strtotime() function which I use to get a timestamp instead of a date/time string does not understand any of these date/time formats. - Is it possible to manually define a datestyle so Postgresql returns a date/time string which strtotime does understand? - Is it possible to let Postgresql return just a timestamp instead of a date/time string - Is there another function in php which does understand standard ISO or SQL style date/time strings and converts them to a timestamp? thanks in advance -- Rien Broekstra a.k.a Rienzilla ICQ: 35629366 The Drunk Snipers: unreal.snt.utwente.nl Mail: rien@rename-it.student.utwente.nl Vestingbar: www.vestingbar.nl