Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Writing Hebrew Dates in Hebrew

by sachss (Sexton)
on Sep 19, 2016 at 01:59 UTC ( #1172090=perlquestion: print w/replies, xml ) Need Help??

sachss has asked for the wisdom of the Perl Monks concerning the following question:

Greetings, O' Wise and Knowledge,

Does anyone know how to convert a English-ize Hebrew Date such as

"15 Elul 5776" into "ט''ו אלאל תשע''ו"

without doing a lookup replacement for each part?

Or is that the only way?

Replies are listed 'Best First'.
Re: Writing Hebrew Dates in Hebrew
by Your Mother (Archbishop) on Sep 19, 2016 at 02:34 UTC

    This isn’t a full answer but might get you pretty close to real/robust date handling with just a little bit of trivial Hebrew formatting, via hashes, left to do. I recommend suggesting a patch or bringing up the issue of “native” formatting to the module authors; DateTime::Calendar::Hebrew.

    #!/usr/bin/env perl use strictures; use utf8; use DateTime::Calendar::Hebrew; my $count; my %months = map {; $_ => ++$count } qw/ Nissan Iyar Sivan Tamuz Av Elul Tishrei Cheshvan Kislev Tevet Shevat AdarI AdarII /; for ( <DATA> ) { my ( $day, $month_name, $year ) = split; my $dt = DateTime::Calendar::Hebrew ->new( year => $year, month => $months{$month_name}, day => $day ); print $dt->ymd, $/; } __DATA__ 15 Elul 5776
    5776-06-15
Re: Writing Hebrew Dates in Hebrew
by Anonymous Monk on Sep 19, 2016 at 02:37 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1172090]
Approved by kevbot
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2022-07-02 05:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (102 votes). Check out past polls.

    Notices?