in reply to DateSerial Win32::OLE
This will only work if you are using the English locale settings; otherwise the string format of the date may be different. You can force the locale used by Win32::OLE to English like this:use Win32::OLE::Variant; sub DateSerial { my($year,$month,$day) = @_; return Variant(VT_BSTR, "$month/$day/$year")->As(VT_DATE); }
use Win32::OLE::NLS qw(:DEFAULT :LANG :SUBLANG); my $english = MAKELCID( MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL) ); Win32::OLE->Option(LCID => $english);
|
|---|