Powershell没有设置准确的修改时间?

Bac*_*ner 0 windows powershell datetime ntfs microsoft-file-explorer

所以我并不介意,这也不是非常重要,但我编写了一个 powershell 脚本来设置编解码器转换的家庭电影的时间。原始文件 ext 被命名为 MP44,生成的文件 ext 为 MP4。我只是想了解为什么时间不完全相同。

资源管理器文件日期不匹配

 Directory of C:\Users\zzz\Desktop\family videos and images\hero 2021

2022-03-18  05:24 PM    <DIR>          .
2022-03-16  07:18 AM    <DIR>          ..
2020-09-02  07:15 PM        79,353,358 ffmpeg.exe
2020-09-02  07:15 PM        79,214,606 ffplay.exe
2020-09-02  07:15 PM        79,249,422 ffprobe.exe
2022-03-16  09:45 PM               482 go.bat
2021-12-24  09:14 PM     4,000,895,516 GX010066.MP44
2021-12-24  09:14 PM       741,345,212 GX010066.MP44.ffmpeg.mp4
2021-12-24  10:25 PM     4,003,210,355 GX010067.MP44
2021-12-24  10:25 PM       687,471,776 GX010067.MP44.ffmpeg.mp4
2021-12-24  09:15 PM     4,001,034,065 GX020066.MP44
2021-12-24  09:15 PM       719,404,024 GX020066.MP44.ffmpeg.mp4
2021-12-24  10:27 PM     3,629,297,689 GX020067.MP44
2021-12-24  10:27 PM       635,027,797 GX020067.MP44.ffmpeg.mp4
2021-12-24  09:17 PM     4,000,513,626 GX030066.MP44
2021-12-24  09:17 PM       690,608,291 GX030066.MP44.ffmpeg.mp4
2021-12-24  09:17 PM       714,946,960 GX040066.MP44
2021-12-24  09:17 PM       125,647,486 GX040066.MP44.ffmpeg.mp4
2022-03-18  05:36 PM               537 timechanger.ps1
              17 File(s) 24,187,221,202 bytes
               2 Dir(s) 

Directory shows same times/dates.

I guess it's more of a windows question than a powershell question.  Why would explorer show different modified dates?

Here is my powershell for posterity:

 $files = Get-ChildItem  *.mp44 | select Name, LastWritetime
foreach ($file in $files) { 
                $currentname = $file.name
                #$currentname
                $currentsubstring = $currentname.substring(0,8)
                #$currentsubstring
                $WriteTime = $file.LastWritetime
                #$WriteTime
                write-host "Going to get-item $currentsubstring.MP44.ffmpeg.mp4 and set $Writetime"
                $targetfile = "$currentsubstring.MP44.ffmpeg.mp4"
                $Targettime = $Writetime
                $bacon = Get-Item $targetfile
                $bacon.LastWritetime = $targettime
                }

Run Code Online (Sandbox Code Playgroud)

预先感谢您的时间和帮助。

The*_*ian 5

因为 Windows 资源管理器中显示的“日期”列是“创建日期”属性,而不是“上次修改日期”。

在此输入图像描述

请注意屏幕截图中的“日期”列如何与“创建日期”列匹配,而不是“修改日期”列。