Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Java::JCR::Calendar 0.08

    Download button

    No screenshots available
    Downloads: 448  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Andrew Sterling Hanenkamp | More programs
    Perl Artistic License / FREE
    February 11th, 2008, 14:20 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Java::JCR::Calendar description

    Java::JCR::Calendar is a Perl module that contains utilities for converting dates.

    Java::JCR::Calendar is a Perl module that contains utilities for converting dates.

    SYNOPSIS

    # With DateTime
    use DateTime;

    # Set
    my $datetime = DateTime->now;
    $node->set_property('date', $datetime);

    # Get
    my $datetime = $property->get_date; # DateTime object

    # With Class::Date
    use Class::Date qw( now );

    # Set
    my $class_date = now;
    $node->set_property('date', $class_date);

    # Get
    my $class_date = $property->get_date('Class::Date'); # Class::Date

    # With a custom date class
    Java::JCR::Calendar->register_date_conversion(
    'My::Date::Class', &my_date_class_inflate, &my_date_class_deflate);

    # Set
    my $my_date = My::Date::Class->right_now;
    $property->set_date('date', $my_date);

    # Get
    my $my_date = $property->get_date('My::Date::Class');

    # Or make it the default:
    Java::JCR::Calendar->default_date_class('My::Date::Class');
    my $my_date = $property->get_date;

    This class helps make the translation from java.lang.Calendar to a Perl date/time object as seamless as possible. Since Perl has a plethora of date/time classes and everyone seems to have their own favorite based upon functionality and performance characteristics, I've tried to make this configurable enough that if your favorite isn't supported, you may add it very easily.

    Currently, this class ships with support for the following (if installed):

    DateTime
    Class::Date

    For each of the classes above, a date conversion will be registered if the class can be loaded (i.e., it's installed). The first date conversion registered will be made the default date class.

    I've chosen these classes based upon my experience and knowledge of their development and developers. DateTime is the obvious first choice since it's the most actively developed and best supported module. If you would like to see an additional module supported in the Java::JCR distribution, please send patches to my email address (listed in "AUTHOR") and I will consider it for a future release.

    If none of the above date classes is available and you haven't registered a date conversion for another class, you can't use JCR dates directly. The JCR will convert any date to or from an ISO 8601 string if you use the string accessor/mutators rather than the date accessor/mutators. Any fallback solution I could come up with would be redundant.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    date converter | Java calendar | Perl module | date | calendar | converter

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM