The data which has been entered into excel file is stored as an XML file in one of my tools.

During the XML file storage process, the date value is stored in number format. For Ex: 11-May-2014 ==> 41770. I don't know how it is stored the date value in number format.

Now, I am trying to retrieve the date value which was stored in the XML file using "DateTime::Format::Excel" module. The code snippet is attached below,

Could anyone please tell me, how to change the language (English, French, German, etc.,) of the date value printed. But, i need the format should be "DD-Abbreviated Month Name-YYYY"

use DateTime::Format::Excel; use Date::Simple qw(d8); use XML::Simple; use String::Util("trim"); $RequiredValue = "%XML_FILE_ABSOLUTE_PATH%"; $XmlHandle = XMLin($RequiredValue, SuppressEmpty => 1); $temp = trim($XmlHandle -> {Date}); $DateVal = DateTime::Format::Excel -> parse_datetime($temp) -> ymd(); $DateVal =~ s/-//g; print (d8($DateVal)->format("%d-%b-%Y"));

In reply to How to change the language of Date value retrieved from XML file which was stored in number format using DateTime::Format::Excel module in Perl by Kottur

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.