Re: EASY!!! Timestamp conversion & php - Mailing list pgsql-general

From Jason Earl
Subject Re: EASY!!! Timestamp conversion & php
Date
Msg-id 87660x5zng.fsf@npa01zz001.simplot.com
Whole thread Raw
In response to EASY!!! Timestamp conversion & php  (eric.jones@hua.army.mil)
List pgsql-general
I couldn't help but answer an email that starts:

CLASSIFICATION: UNCLASSIFIED

What you need to do is take a look at the to_char function in Chapter
4.7 of the PostgreSQL User's Guide.

For example if you wanted to get the current timestamp in the format
you specified you would need to do something like:

SELECT to_char(CURRENT_TIMESTAMP, 'FMMonth FMDD, YYYY HH24:MI');

Jason

eric.jones@hua.army.mil writes:

> CLASSIFICATION: UNCLASSIFIED
>
> Can anyone tell me how to convert this PG timestamptz: 2002-06-05
> 10:39:02.480922-07
>
> To June 5, 2002 10:39
>
> I try this code:
>
> <?=date("M j, Y",strtotime(2002-06-05 10:39:02.480922-07))?>
>
> And I get Dec 31, 1969 so I know it's not working....
>
> Help!!!
>
> Eric Jones (Contractor)
> FDIC Web Enabler
> E-mail: jonese@hua.army.mil
> Office - 520-533-6628
> Cell - 520-980-2136
> Email Pager - 5209802136@messaging.nextel.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

pgsql-general by date:

Previous
From: eric.jones@hua.army.mil
Date:
Subject: EASY!!! Timestamp conversion & php
Next
From: Neil Conway
Date:
Subject: Re: Insight into indexes? (or inverting then externally)