[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
Re: [ic] [perl]
At 11:07 AM 06/06/2001 +0100, you wrote:
>I want to display this date 20010701 in this format 01/07/001
>why this doesn't work?
>
>[perl]
Try:
[perl interpolate=1]
$data = '[item-field noticia_dataactivacao]';
...
return "$dia/$mez/$ano";
[/perl]
Another (shorter) way to do this is:
$data =~ /(\d\d\d\d)(\d\d)(\d\d)/;
return "$2/$1/$3";
- Ed L.
>
>$data=[item-field noticia_dataactivacao];
>
>$ano = substr($data, 0, 4);
>$mez = substr($data, 4, 2);
>$dia = substr($data, 6, 2);
>
>return $ano;
>return "/";
>return $mez;
>return "/";
>return $dia;
>
>[/perl]
>
>Yann carlier
>+351-21-4527104/5
><http://www.inteliware.net>www.inteliware.net
><mailto:yann.carlier@inteliware.net>yann.carlier@inteliware.net
===============================================================
New Media E.M.S. Software Solutions for Business
463 Main St., Suite D eCommerce | Consulting | Hosting
Placerville, CA 95667 edl@newmediaems.com
(530) 622-9421 http://www.newmediaems.com
(866) 519-4680 Toll-Free (530) 622-9426 Fax
===============================================================