The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Time::Piece::MSSQL - MSSQL-specific methods for Time::Piece

VERSION

version 0.023

SYNOPSIS

 use Time::Piece::MSSQL;

 my $time = localtime;

 print $time->mssql_datetime;
 print $time->mssql_smalldatetime;

 my $time = Time::Piece->from_mssql_datetime( $mssql_datetime );
 my $time = Time::Piece->from_mssql_smalldatetime( $mssql_smalldatetime );

DESCRIPTION

This module adds functionality to Time::Piece, providing methods useful for using the object in conjunction with a Microsoft SQL database connection. It will produce and parse MSSQL's default-format datetime values.

PERL VERSION

This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years.

Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl.

METHODS

mssql_datetime

mssql_smalldatetime

These methods return the Time::Piece object, formatted in the default notation for the correct MSSQL datatype.

from_mssql_datetime

  my $time = Time::Piece->from_mssql_datetime($timestring);

from_mssql_smalldatetime

  my $time = Time::Piece->from_mssql_smalldatetime($timestring);

These methods construct new Time::Piece objects from the given strings, which must be in the default MSSQL format for the correct datatype. If the string is empty, undefined, or unparseable, undef is returned.

FINAL THOUGHTS

This module saves less time than Time::Piece::MySQL, because there are fewer strange quirks to account for, but it becomes useful when tied to autoinflation of datatypes in Class::DBI::MSSQL.

AUTHOR

Ricardo SIGNES <cpan@semiotic.systems>

CONTRIBUTORS

  • Ricardo SIGNES <rjbs@codesimply.com>

  • Ricardo Signes <rjbs@semiotic.systems>

COPYRIGHT AND LICENSE

This software is copyright (c) 2005 by Ricardo SIGNES.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.