# New Ticket Created by  sftf 
# Please include the string:  [perl #128506]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=128506 >


OS: Windows Server 2012 R2 Standard
FS: NTFS
TZ: +06:00

=== perl5
e:\temporary>perl -v
This is perl 5, version 22, subversion 0 (v5.22.0) built for 
MSWin32-x64-multi-thread

e:\temporary>type ctime.pl
use File::stat;
use Time::Piece;

my $fn1 = 't:\temporary\tia\Энергия\print.pdf';
my $fn2 = 't:\temporary\tia\Энергия\kl_to_1c.txt';
for ($fn1,$fn2) {
    my $fs = stat($_);
    print "$_\n";
    print 'changed  ',gmtime($fs->ctime)->datetime,"\n";
    print 'modified ',gmtime($fs->mtime)->datetime,"\n";
    print 'accessed ',gmtime($fs->atime)->datetime,"\n";
}

e:\temporary>perl ctime.pl
t:\temporary\tia\Энергия\print.pdf
changed  2016-06-30T03:50:54 <== (1)
modified 2016-05-04T03:03:08
accessed 2016-06-30T03:50:54
t:\temporary\tia\Энергия\kl_to_1c.txt
changed  2016-06-30T03:50:54 <== (3)
modified 2016-06-30T03:12:35
accessed 2016-06-30T03:50:54


=== perl6
e:\temporary>perl6 -v
This is Rakudo version 2016.04 built on MoarVM version 2016.04
implementing Perl 6.c.

e:\temporary>type ctime.pl6
use v6;
my $fio1 = 't:\temporary\tia\Энергия\print.pdf'.IO;
my $fio2 = 't:\temporary\tia\Энергия\kl_to_1c.txt'.IO;

for $fio1,$fio2 {
    say .path;
    say 'changed  ', .changed.DateTime.truncated-to('second');
    say 'modified ', .modified.DateTime.truncated-to('second');
    say 'accessed ', .accessed.DateTime.truncated-to('second');

}

e:\temporary>perl6 ctime.pl6
t:\temporary\tia\Энергия\print.pdf
changed  2016-05-04T03:03:08Z <== (2)
modified 2016-05-04T03:03:08Z
accessed 2016-06-30T03:50:54Z
t:\temporary\tia\Энергия\kl_to_1c.txt
changed  2016-06-30T04:10:08Z <== (4)
modified 2016-06-30T03:12:35Z
accessed 2016-06-30T03:50:54Z

(1) and (3) is what Windows show in file properties as 'Created'.
(1),(2) and (3),(4) are different.

Reproducing (1),(2).
1) Create file with text editor. Difference will be in seconds.
>From perl5:
  changed  2016-06-30T16:38:42
  modified 2016-06-30T16:38:48
  accessed 2016-06-30T16:38:42

>From perl6:
  changed  2016-06-30T16:38:48Z
  modified 2016-06-30T16:38:48Z
  accessed 2016-06-30T16:38:42Z

2) Edit this file several minutes later.  Difference will be more noticeable.
>From perl5:
  changed  2016-06-30T16:38:42 <==
  modified 2016-06-30T16:49:17
  accessed 2016-06-30T16:38:42

>From perl6:
  changed  2016-06-30T16:49:17Z <==
  modified 2016-06-30T16:49:17Z
  accessed 2016-06-30T16:38:42Z

Reply via email to