howto Date Time string from MYSQL to German Format

S

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
 
M

Mumia W.

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__
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top