Here it is with calls to the Win32 API. I don't know if this is any more accurate, but it worked fine on my system.
#!/usr/bin/perl -w use strict; use Win32::API; use Win32API::File (qw/:ALL/); my $filename = "file.txt"; my $GetFileTime = new Win32::API("kernel32", "GetFileTime", ['N', 'P', + 'P', 'P' ], 'I'); my $hFile= CreateFile( $filename, GENERIC_READ(), FILE_SHARE_READ(), [], OPEN_EXISTING() , 0, []) or die "Can't re +ad file $filename"; my %filetime =( create=>undef,access=>undef,write=>undef ); for (keys %filetime) { $filetime{$_} = pack("LL", 0, 0); } $GetFileTime->Call($hFile,$filetime{'create'},$filetime{'access'},$fil +etime{'write'}); for (keys %filetime) { my $filetimepointer = $filetime{$_}; my $systemtime = pack("SSSSSSSS",0,0,0,0,0,0,0,0); my $FileToSystem = new Win32::API("kernel32", "FileTimeToSyste +mTime", ['P','P'] , 'I'); $FileToSystem->Call($filetimepointer,$systemtime); my($year,$month,$weekday,$day,$hour,$minute,$second,$msecond) += unpack("SSSSSSSS",$systemtime); printf ("$_ time:\t %d/%02d/%02d %02d:%02d:%02d", $month, $day +, $year ,$hour,$minute,$second); print "\n"; }

In reply to Re: How to find the create time of a file under MS by thunders
in thread How to find the create time of a file under MS by demerphq

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.