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 > Libraries

    DateTime::Format::Pg 0.16007

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Claus A. Frber | More programs
    Perl Artistic License / FREE
    December 11th, 2011, 09:03 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    DateTime::Format::Pg description

    A Perl module to parse and format PostgreSQL dates and times.

    DateTime::Format::Pg is a Perl module to parse and format PostgreSQL dates and times.

    SYNOPSIS

    use DateTime::Format::Pg;

    my $dt = DateTime::Format::Pg->parse_datetime( '2003-01-16 23:12:01' );

    # 2003-01-16T23:12:01+0200
    DateTime::Format::Pg->format_datetime($dt);


    This module understands the formats used by PostgreSQL for its DATE, TIME, TIMESTAMP, and INTERVAL data types. It can be used to parse these formats in order to create DateTime or DateTime::Duration objects, and it can take a DateTime or DateTime::Duration object and produce a string representing it in a format accepted by PostgreSQL.

    CONSTRUCTORS

    The following methods can be used to create DateTime::Format::Pg objects.
    new( name => value, ... )

    Creates a new DateTime::Format::Pg instance. This is generally not required for simple operations. If you wish to use a different parsing style from the default then it is more comfortable to create an object.

    my $parser = DateTime::Format::Pg->new()
    my $copy = $parser->new( 'european' => 1 );

    This method accepts the following options:

    european

    If european is set to non-zero, dates are assumed to be in european dd/mm/yyyy format. The default is to assume US mm/dd/yyyy format (because this is the default for PostgreSQL).

    This option only has an effect if PostgreSQL is set to output dates in the 'PostgreSQL' (DATE only) and 'SQL' (DATE and TIMESTAMP) styles.
    Note that you don't have to set this option if the PostgreSQL server has been set to use the 'ISO' format, which is the default.

    server_tz

    This option can be set to a DateTime::TimeZone object or a string that contains a time zone name.

    This value must be set to the same value as the PostgreSQL server's time zone in order to parse TIMESTAMP WITH TIMEZONE values in the 'PostgreSQL', 'SQL', and 'German' formats correctly.

    Note that you don't have to set this option if the PostgreSQL server has been set to use the 'ISO' format, which is the default.

    clone()

    This method is provided for those who prefer to explicitly clone via a method called clone().

    my $clone = $original->clone();

    If called as a class method it will die.

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    format PostgreSQL dates | format PostgreSQL times | Perl module | DateTime::Format::Pg | format | PostgreSQL

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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