(20)
時刻=>UNIX時刻
date -d '2021/12/31 11:22:33' "+%s"
UNIX時刻=>時刻
date -d @1640949753 "+%Y/%m/%d %H:%M:%S"
時刻書式変更
date -d '2021/12/31 11:22:33' "+%Y %m %d %H %M %S"
date -d '2021-12-31 11:22:33' "+%Y %m %d %H %M %S"
date -d '20211231 11:22:33' "+%Y %m %d %H %M %S"
date -d '2021/12/31' "+%Y %m %d"
date -d '2021-12-31' "+%Y %m %d"
date -d '20211231' "+%Y %m %d"
時刻の演算
date -d '2021/01/01 00:00:00 1 sec' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 minute' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 hour' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 day' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 month' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 year' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 sec ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 minute ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 hour ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 day ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 month ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 year ago' "+%Y/%m/%d %H:%M:%S"
(10)
時刻=>UNIX時刻
date -d '2021/12/31 11:22:33' "+%s"
UNIX時刻=>時刻
date -d @1640949753 "+%Y/%m/%d %H:%M:%S"
時刻書式変更
date -d '2021/12/31 11:22:33' "+%Y %m %d %H %M %S"
date -d '2021-12-31 11:22:33' "+%Y %m %d %H %M %S"
date -d '20211231 11:22:33' "+%Y %m %d %H %M %S"
date -d '2021/12/31' "+%Y %m %d"
date -d '2021-12-31' "+%Y %m %d"
date -d '20211231' "+%Y %m %d"
時刻の演算
date -d '2021/01/01 00:00:00 1 sec' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 minute' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 hour' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 day' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 month' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 year' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 sec ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 minute ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 hour ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 day ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 month ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 year ago' "+%Y/%m/%d %H:%M:%S"
(8)
時刻=>UNIX時刻
date -d '2021/12/31 11:22:33' "+%s"
UNIX時刻=>時刻
date -d @1640949753 "+%Y/%m/%d %H:%M:%S"
時刻書式変更
date -d '2021/12/31 11:22:33' "+%Y %m %d %H %M %S"
date -d '2021-12-31 11:22:33' "+%Y %m %d %H %M %S"
date -d '20211231 11:22:33' "+%Y %m %d %H %M %S"
date -d '2021/12/31' "+%Y %m %d"
date -d '2021-12-31' "+%Y %m %d"
date -d '20211231' "+%Y %m %d"
時刻の演算
date -d '2021/01/01 00:00:00 1 sec' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 minute' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 hour' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 day' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 month' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 year' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 sec ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 minute ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 hour ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 day ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 month ago' "+%Y/%m/%d %H:%M:%S"
date -d '2021/01/01 00:00:00 1 year ago' "+%Y/%m/%d %H:%M:%S"
- Windows Server
(2019)
https://qiita.com/tsubasaxZZZ/items/ca95ecb129acabb7fba8
https://qiita.com/ryosuke0825/items/06eae2e99f587b5275aa
https://atmarkit.itmedia.co.jp/ait/articles/0409/03/news087.html
NTタイムエポック
1601年1月1日0時0分からの100ナノ秒単位
時刻=>Windows時刻
(Get-Date "2021/12/31 11:22:33").ToFileTime()
Windows時刻=>時刻
[datetime]::FromFileTime("132853909530000000")
時刻書式変更
$date = [DateTime]::ParseExact("2021/12/31 11:22:33","yyyy/MM/dd HH:mm:ss", $null);
$date.ToString("yyyy MM dd HH mm ss")
$date = [DateTime]::ParseExact("2021-12-31 11:22:33","yyyy-MM-dd HH:mm:ss", $null);
$date.ToString("yyyy MM dd HH mm ss")
$date = [DateTime]::ParseExact("20211231 11:22:33","yyyyMMdd HH:mm:ss", $null);
$date.ToString("yyyy MM dd HH mm ss")
$date = [DateTime]::ParseExact("2021/12/31","yyyy/MM/dd", $null);
$date.ToString("yyyy MM dd")
$date = [DateTime]::ParseExact("2021-12-31","yyyy-MM-dd", $null);
$date.ToString("yyyy MM dd")
$date = [DateTime]::ParseExact("20211231","yyyyMMdd", $null);
$date.ToString("yyyy MM dd")
時刻の演算
$date = [DateTime]::ParseExact("2021/12/31 11:22:33","yyyy/MM/dd HH:mm:ss", $null);
$date.Addseconds(1).ToString("yyyy/MM/dd HH:mm:ss")
$date.AddMinutes(1).ToString("yyyy/MM/dd HH:mm:ss")
$date.AddHours(1).ToString("yyyy/MM/dd HH:mm:ss")
$date.AddDays(1).ToString("yyyy/MM/dd HH:mm:ss")
$date.AddMonths(1).ToString("yyyy/MM/dd HH:mm:ss")
$date.AddYears(1).ToString("yyyy/MM/dd HH:mm:ss")
$date.Addseconds(-1).ToString("yyyy/MM/dd HH:mm:ss")
$date.AddMinutes(-1).ToString("yyyy/MM/dd HH:mm:ss")
$date.AddHours(-1).ToString("yyyy/MM/dd HH:mm:ss")
$date.AddDays(-1).ToString("yyyy/MM/dd HH:mm:ss")
$date.AddMonths(-1).ToString("yyyy/MM/dd HH:mm:ss")
$date.AddYears(-1).ToString("yyyy/MM/dd HH:mm:ss")