pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Timothy_Maguire@hartehanks.com
To: Rien Broekstra <rien@cal018043.student.utwente.nl>
Cc: pgsql-php@postgresql.org
Subject: Re: strtotime() and postgresql date/time output
Date: Mon, 29 Jan 2001 10:14:47 -0500
Message-ID: <OF36D11778.101291A7-ON852569E3.0052597C@hartehanks.com> (raw)


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 <rien@cal018043.student.utwente.nl>@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







view thread (2+ messages)

Message-ID: <OF36D11778.101291A7-ON852569E3.0052597C@hartehanks.com>
Permalink:  ../OF36D11778.101291A7-ON852569E3.0052597C@hartehanks.com/
Also on:    postgresql.org/message-id/OF36D11778.101291A7-ON852569E3.0052597C@hartehanks.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: Timothy_Maguire@hartehanks.com, rien@cal018043.student.utwente.nl
  Subject: Re: strtotime() and postgresql date/time output
  In-Reply-To: <OF36D11778.101291A7-ON852569E3.0052597C@hartehanks.com>
  References: <OF36D11778.101291A7-ON852569E3.0052597C@hartehanks.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