Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Date::Indian module

by irah (Pilgrim)
on Jun 11, 2009 at 09:43 UTC ( #770576=perlquestion: print w/replies, xml ) Need Help??
irah has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks,

my $date = Date::Indian->new( ymd => '2009:6:11', tz => '5:30', locn => '78:18 17:12' );

I am calling new function in Date::Indian module. As of my knowledge, I understand from the variable name, the third argument of the function mentioning location. Please correct me, if my understand is wrong.

Also explain me, How the value is given for this argument?. For example, the value for tz is based on timezone. Similarly how it is given for this variable?.

Replies are listed 'Best First'.
Re: Date::Indian module
by afoken (Abbot) on Jun 11, 2009 at 11:40 UTC

    I was tempted to write "RTFM", but in this case, the FM is not very fine. I guess that locn is latitude and longitude, as stated in a comment in the source:

    locn  => undef,   # ex: locn  =>'82:30E 17:25N'

    Reading the source is somewhat frightening. It contains at three undocumented packages without a reasonable prefix (Sun, Moon, Util), and its full of magic numbers without any explaining comment. There are lots of debugging artefacts. It completely lacks any sanity checks, and at least the example in the comment cited above is wrong. Looking at the code of sub _dolocn, the locn should not contain letters.

    You should better treat Date::Indian as pre-alpha code, i.e. avoid it for production use.

    You could try to contact the author, but I would not hope for an answer. His last upload is dated "27 Aug 2003".


    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re: Date::Indian module
by syphilis (Chancellor) on Jun 11, 2009 at 12:07 UTC
Re: Date::Indian module
by jaldhar (Vicar) on Jun 11, 2009 at 17:43 UTC

    This module is a huge mess. How bad is it? Even the name is wrong. It doesn't deal with "Indian dates" but a particular kind of luni-solar calendar which only one of the several traditionally used in India. And even then it only gives you the basic numbers you need to actually calculate the date. One of these days I will actually release DateTime::Calendar::Indic to CPAN and working with various traditional Indian calendars will be much easier. In the meantime, if you really want to use this module, you call the constructor like this:

    my $date = Date::Indian->new( ymd => "YYYY-MM-DD", # month = 1-12 tz => 'HH:MM', # time offset from +Greenwich. Negative if West of Greenwich locn => 'HH:MMD HH:MMD', # longitude and latitude, D = + E or W for longitude and N or S for latitude );


Re: Date::Indian module
by Anonymous Monk on Jun 11, 2009 at 11:30 UTC

    Read document of this module in CPAN

      The snippet the OP posted is from the synopsis in the docs. That is the only reference to locn which is probably why the question is being asked.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://770576]
Approved by targetsmart
[LanX]: enjoy :)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2017-08-21 17:06 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (324 votes). Check out past polls.