| Win32-SqlServer-DTS documentation | Contained in the Win32-SqlServer-DTS distribution. |
Win32::SqlServer::DTS::DateTime - DateTime Perl object built from Win32::OLE Variant values
use Win32::SqlServer::DTS::DateTime; use Win32::OLE::Variant; my $variant = Variant( VT_DATE, "April 1 99" ); my $date = Win32::SqlServer::DTS::DateTime->new($variant);
Extends the DateTime class constructor (new method) to create a DateTime object that is equal to a
Win32::OLE::Variant object.
Some classes in DTS distribution have methods that returns date/time values, but as Variants. Win32::SqlServer::DTS::DateTime objects
are used as substitutes.
Most attributes returned as date/time variants from DTS API original classes are read-only, so beware that changing a
Win32::SqlServer::DTS::DateTime object attribute because, as long as it seems to work, it will not save the state in the DTS package: the Win32::SqlServer::DTS::DateTime
is "disconnected" from the original date/time variant.
Nothing.
Expects a Win32::OLE::Variant date object as a parameter.
Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
Copyright (C) 2008 by Alceu Rodrigues de Freitas Junior
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
| Win32-SqlServer-DTS documentation | Contained in the Win32-SqlServer-DTS distribution. |
package Win32::SqlServer::DTS::DateTime;
use 5.008008; use strict; use warnings; use base qw(DateTime); use Params::Validate qw(validate_pos); our $VERSION = '0.01';
sub new { my $class = shift; validate_pos( @_, { isa => 'Win32::OLE::Variant' } ); my $variant_timestamp = shift; my $self = $class->SUPER::new( year => $variant_timestamp->Date('yyyy'), month => $variant_timestamp->Date('M'), day => $variant_timestamp->Date('d'), hour => $variant_timestamp->Time('H'), minute => $variant_timestamp->Time('m'), second => $variant_timestamp->Time('s'), ); return $self; } 1; __END__