From: Matt S Trout Date: Sat, 20 May 2006 00:34:39 +0000 (+0000) Subject: added datetime parser for MSSQL (ta LTJake) X-Git-Tag: v0.07002~75^2~182^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ed8de058d4898d62c85d317f741ec3ac50bb6ad2;p=dbsrgits%2FDBIx-Class.git added datetime parser for MSSQL (ta LTJake) --- diff --git a/lib/DBIx/Class/Storage/DBI/MSSQL.pm b/lib/DBIx/Class/Storage/DBI/MSSQL.pm index 171c17a..a303d25 100644 --- a/lib/DBIx/Class/Storage/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Storage/DBI/MSSQL.pm @@ -11,6 +11,14 @@ sub last_insert_id { my( $id ) = $_[0]->_dbh->selectrow_array('SELECT @@IDENTITY' ); return $id; } + +sub build_datetime_parser { + my $self = shift; + my $type = "DateTime::Format::Strptime"; + eval "use ${type}"; + $self->throw_exception("Couldn't load ${type}: $@") if $@; + return $type->new( pattern => '%m/%d/%Y %H:%M:%S' ); +} 1;