PowerShell - 将刻度转换为时间 [英] PowerShell - Convert Ticks to Time
本文介绍了PowerShell - 将刻度转换为时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用 PowerShell Get-Date 小程序将日期/时间转换为刻度很简单.但是,你如何做相反的操作;将刻度转换回日期和时间?
Converting dates/times into ticks using the PowerShell Get-Date applet is simple. However, how do you do the opposite operation; converting the ticks back into a date and time?
推荐答案
[DateTime]10000000000
Monday, January 01, 0001 12:16:40 AM
只需将数字转换为 DateTime
.DateTime
单参数构造函数采用 long
作为刻度数.
Just cast the number into a DateTime
. The DateTime
single-parameter constructor takes a long
as number of ticks.
这篇关于PowerShell - 将刻度转换为时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文