a new question

a new question

am 18.03.2005 00:35:30 von enzo venegas palacios

hi, my problem is very basic (and my english too)

i have a variable with a date (timestamp format)
$fecha =3D mm-dd-yyy hh:mm:ss

i need to display only the date and not the hour

$only_date =3D ??? ($fecha);

echo $only_date;
display =3D mm-dd-aaaa


enzo
---------------------------------------------------------
Redecora tu m=F3vil. Redecora tu vida. =BFPor qu=E9 no? Con http://logos.ya=
..com es posible
ADSL + Llamadas 24 horas: desde 28,95 =80/mes + IVA. Navega y habla de form=
a ilimitada. Sin compromiso de permanencia. http://acceso.ya.com/ADSLllamad=
as/


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Re: a new question

am 18.03.2005 03:14:35 von Michael Glaesemann

> enzo venegas palacios wrote:
>
>> hi, my problem is very basic (and my english too)
>>
>> i have a variable with a date (timestamp format)
>> $fecha = mm-dd-yyy hh:mm:ss
>>
>> i need to display only the date and not the hour
>>
>> $only_date = ??? ($fecha);
>>
>> echo $only_date;
>> display = mm-dd-aaaa

On Mar 18, 2005, at 12:48, Todd Lewis wrote:

> you can use to_char(timestamp,'mm-dd-yyy') where timestamp is your
> couln name. You can place this in your select section.
>

Or you can use extract('epoch' from yourtimestamp) to return an UNIX
timestamp to PHP, and then use PHP's date formating functions.

Michael Glaesemann
grzm myrealbox com


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Re: a new question

am 18.03.2005 04:48:42 von Todd Lewis

you can use to_char(timestamp,'mm-dd-yyy') where timestamp is your couln=20
name. You can place this in your select section.

enzo venegas palacios wrote:

>hi, my problem is very basic (and my english too)
>
>i have a variable with a date (timestamp format)
>$fecha =3D mm-dd-yyy hh:mm:ss
>
>i need to display only the date and not the hour
>
>$only_date =3D ??? ($fecha);
>
>echo $only_date;
>display =3D mm-dd-aaaa
>
>
>enzo
>---------------------------------------------------------
>Redecora tu m=F3vil. Redecora tu vida. =BFPor qu=E9 no? Con http://logos=
..ya.com es posible
>ADSL + Llamadas 24 horas: desde 28,95 =80/mes + IVA. Navega y habla de f=
orma ilimitada. Sin compromiso de permanencia. http://acceso.ya.com/ADSLl=
lamadas/
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 7: don't forget to increase your free space map settings
>
> =20
>


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Re: a new question

am 18.03.2005 23:07:06 von Bastiaan Wakkie

Hi enzo,

In your select statement you do this:
SELECT date_part('MONTH',date) as month, date_part('DAY',date) as day,
date_part('YEAR',date) as year
....

then in php the following:
displayDate =3D month."-".day."-".year

Cheers,
--=20
^(B(astia{2}n)?)(\s)?(W(ak{2}ie)?)$

On Thu, 2005-03-17 at 18:35 -0500, enzo venegas palacios wrote:
> hi, my problem is very basic (and my english too)
>=20
> i have a variable with a date (timestamp format)
> $fecha =3D mm-dd-yyy hh:mm:ss
>=20
> i need to display only the date and not the hour
>=20
> $only_date =3D ??? ($fecha);
>=20
> echo $only_date;
> display =3D mm-dd-aaaa
>=20
>=20
> enzo
> ---------------------------------------------------------
> Redecora tu m=F3vil. Redecora tu vida. =BFPor qu=E9 no? Con http://logo=
s.ya.com es posible
> ADSL + Llamadas 24 horas: desde 28,95 =A4/mes + IVA. Navega y habla de =
forma ilimitada. Sin compromiso de permanencia. http://acceso.ya.com/ADSL=
llamadas/
>=20
>=20
> ---------------------------(end of broadcast)--------------------------=
-
> TIP 7: don't forget to increase your free space map settings



---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if you=
r
joining column's datatypes do not match