howto Date Time string from MYSQL to German Format

howto Date Time string from MYSQL to German Format

am 21.10.2007 12:58:13 von sanitarysystems

I want to format DateTime string which looks like "2007-10-12
14:00:00" to German Format like "Montag, den 12. Oktober 2007"

This code (1) does not work:
$german_date = ParseDate('2007-10-12 14:00:00');
printf ("Minverbraucht : %s\n",Date_to_Text_Long($german_date));

this code (2) works, because @anliefertag is already formatted as
DateTime:
printf ("Anliefertag : %s\n",Date_to_Text_Long(@anliefertag))

any solutions from you how to format dateTime in example (1)?

tnx in advance
thomas

Re: howto Date Time string from MYSQL to German Format

am 21.10.2007 14:54:54 von paduille.4061.mumia.w+nospam

On 10/21/2007 05:58 AM, sanitarysystems@googlemail.com wrote:
> I want to format DateTime string which looks like "2007-10-12
> 14:00:00" to German Format like "Montag, den 12. Oktober 2007"
>
> This code (1) does not work:
> $german_date = ParseDate('2007-10-12 14:00:00');
> printf ("Minverbraucht : %s\n",Date_to_Text_Long($german_date));
>
> this code (2) works, because @anliefertag is already formatted as
> DateTime:
> printf ("Anliefertag : %s\n",Date_to_Text_Long(@anliefertag))
>
> any solutions from you how to format dateTime in example (1)?
>
> tnx in advance
> thomas
>


use strict;
use warnings;
require Date::Parse;
require Date::Language;
Date::Parse->import;
my $lang = Date::Language->new('German');

my $german_date = str2time('2007-10-12 14:00:00');
print $lang->time2str("%a den %e, %B %Y\n", $german_date);


__OUTPUT__
Fre den 12, Oktober 2007

__HTH__

Re: howto Date Time string from MYSQL to German Format

am 21.10.2007 15:31:06 von merl the perl

youbetcha.

it's 2007-10-21 at half seven bells.

when you include this module, do it correctly:


use strict;
use warnings;
use Net::NNTP ();

Shooting for the azimuth is different. You go for m*pi s.t. (m+1).times.
pi>target

angstroms are appropriate units. hja.

--
wade ward
wade@zaxfuuq.net
"Der Katze tritt die Treppe hoch; Der Kater tritt sie krumm.%
% De Teufel geit um; er bringt de menschen allet dumm."
schau, schau

wrote in message
news:1192964293.523500.112660@y27g2000pre.googlegroups.com.. .
>I want to format DateTime string which looks like "2007-10-12
> 14:00:00" to German Format like "Montag, den 12. Oktober 2007"
>
> This code (1) does not work:
> $german_date = ParseDate('2007-10-12 14:00:00');
> printf ("Minverbraucht : %s\n",Date_to_Text_Long($german_date));
>
> this code (2) works, because @anliefertag is already formatted as
> DateTime:
> printf ("Anliefertag : %s\n",Date_to_Text_Long(@anliefertag))
>
> any solutions from you how to format dateTime in example (1)?
>
> tnx in advance
> thomas
>