Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
powershell获取系统正在使用的当前日期格式_Powershell - Fatal编程技术网

powershell获取系统正在使用的当前日期格式

powershell获取系统正在使用的当前日期格式,powershell,Powershell,如何使用powershell获取当前系统日期格式?例如,如果我正在使用powershell读取日志文件,我想知道2012-03-01是yyyy-mm-dd还是yyyy-dd-mm 这将为您提供计算机当前区域性的日期时间格式: [cultureinfo]::CurrentCulture.DateTimeFormat 或者更好的是,([cultureinfo]::CurrentCulture.DateTimeFormat).LongDatePattern如果使用[cultureinfo]类型加速器

如何使用powershell获取当前系统日期格式?例如,如果我正在使用powershell读取日志文件,我想知道2012-03-01是yyyy-mm-dd还是yyyy-dd-mm

这将为您提供计算机当前区域性的日期时间格式:

[cultureinfo]::CurrentCulture.DateTimeFormat

或者更好的是,
([cultureinfo]::CurrentCulture.DateTimeFormat).LongDatePattern
如果使用[cultureinfo]类型加速器时出现错误,请将其拼写出来:[System.Globalization.cultureinfo]。