本帖最后由 Nsqs 于 2017-3-27 20:52 编辑
太冷清.贴个源函数实现方法- Function GettickCount(){
- $t=Add-Type -MemberDefinition @'
- [DllImport("kernel32")]
- public static extern int GetTickCount();
- '@ -passthru -name SystemTickTime
- Return $t::GetTickCount()
- }
- [string]$s=[regex]'(\d+)\..+|\d+'
- [int]$t=(GetTickCount)
- [string[]]$r=($t/1000/86400),($t/1000/3600),($t/1000/60%60),($t/1000%60) -replace $s,'$1'
- $r[0]+'天'+$r[1]+'时'+$r[2]+'分'+$r[3]+'秒'
复制代码
|