Some of you Might have realized from
Waiting ... That I am new to Perl OLE usage. I now have the following Problem: I have times in this format:
00/01/1900 00:31:00
I am retreiving these times with the follwing piece of code:
if ( ref( $value ) =~ /Variant/ ){
if ( $iRef == 4 || $iRef == 6 ){
$value = $value->Date( "dd/MM/yy" );
} elsif ( $iRef == 5 || $iRef == 7 ){
$value = $value->Time( "hh:mm:ss" );
}
}
if ( $values ne "" && $value =~ /^\d?\.\d*$/ ){
print $value;
my $seconds = $value * 60 * 60 * 24;
print $seconds;
my ( undef, undef, undef, $hour,$min,$sec)= Date::Calc::Add_Delta_
+DHMS( 1900, 1, 1, 0, 0, 0, 0,0,0, $seconds);
$value = sprintf( "%02u:%02u:%02u", $hour, $min, $sec );
}
The second bit is used to convert non-Variant times to a time format. Unfortunately the time in the example above is converted as "12:31:00", which as you might imagine has some unpleasant effects. Has anyone any ideas how to tackle this?
I am using AS Perl 5.8.6 and Excel 2002.
Thank you for all help.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.