X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FMSSQL.pm;h=a303d253919b416d577002de4cc66bb1f2c5df01;hb=ca7b9fdf18b093c46189fc5ba00491d1c02f813f;hp=171c17a6a1628abdb499a67c0f55397a00c711c7;hpb=75d079145a507a0e5ff89b2676d383f4fd1a5511;p=dbsrgits%2FDBIx-Class-Historic.git 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;