howto Date Time string from MYSQL to German Format

Discussion in 'Perl Misc' started by sanitarysystems@googlemail.com, Oct 21, 2007.

  1. Guest

    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
     
    , Oct 21, 2007
    #1
    1. Advertising

  2. Mumia W. Guest

    On 10/21/2007 05:58 AM, 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__
     
    Mumia W., Oct 21, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shaiboy_UK
    Replies:
    0
    Views:
    511
    Shaiboy_UK
    Oct 19, 2003
  2. Brian Candy
    Replies:
    2
    Views:
    1,205
    Janaka
    Feb 18, 2004
  3. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,370
    Michael Borgwardt
    May 30, 2004
  4. Summu82
    Replies:
    5
    Views:
    901
    Richard Heathfield
    Jun 7, 2006
  5. dch3
    Replies:
    2
    Views:
    525
Loading...

Share This Page