Anonymous user
File modification time: Difference between revisions
m
→{{header|PowerShell}}: added mentions of LastAccessTime and CreationTime
m (→{{header|PowerShell}}: added mentions of LastAccessTime and CreationTime) |
|||
Line 680:
=={{header|PowerShell}}==
<lang powershell>
$modificationTime = (Get-ChildItem file.txt).LastWriteTime
Set-ItemProperty file.txt LastWriteTime (Get-Date)
$LastReadTime = (Get-ChildItem file.txt).LastAccessTime
Set-ItemProperty file.txt LastAccessTime(Get-Date)
$CreationTime = (Get-ChildItem file.txt).CreationTime
Set-ItemProperty file.txt CreationTime(Get-Date)
</lang>
You can also use alternates to get UTC time:
LastWriteTimeUtc
LastAccessTimeUtc
CreationTimeUtc
=={{header|PureBasic}}==
|