![]() |
howto Date Time string from MYSQL to German Format
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
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__ |
| All times are GMT. The time now is 12:16 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.