Powershell模拟世界时钟

前端之家收集整理的这篇文章主要介绍了Powershell模拟世界时钟前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

下面是编程之家 jb51.cc 通过网络收集整理的代码片段。

编程之家小编现在分享给大家,也给大家做个参考。

<# 
            " Satnaam WaheGuru Ji"     
             
            Author  :  Aman Dhally 
            E-Mail  :  [email protected] 
            website :  www.amandhally.net 
            twitter : https://twitter.com/#!/AmanDhally 
            facebook: http://www.facebook.com/groups/254997707860848/ 
            Linkedin: http://www.linkedin.com/profile/view?id=23651495 
 
            Date    : 26-Sep-2012 
            File    : Remote Office Times 
            Purpose : Get The Remote Office Times 
             
            Version : 1 
 
            my Spider runned Away :(  
 
 
#> 
 
# useful Links  
#   http://www.timeanddate.com/  <- To get the DST and GMT Offset  
 
# Creating New Ps Object 
    $RemoteTIme = New-Object -TypeName Psobject 
#TimeZone 
    $Local = (Get-Date).ToShortTimeString() 
    $Dubai = (Get-Date).ToUniversalTime().AddHours(4).ToShortTimeString() 
    $Delhi = (Get-Date).ToUniversalTime().AddHours(5).AddMinutes(30).ToLongTimeString() 
    $Singa = (Get-Date).ToUniversalTime().AddHours(8).ToShortTimeString() 
# Manchester used Day Light Time Saving so currenlty it is +1 Hours 
    $Manch = (Get-Date).ToUniversalTime().AddHours(1).ToShortTimeString() 
 
# Adding Members to PS Object So that they Looks Nice  
 
    $RemoteTIme | Add-Member -MemberType 'NoteProperty' -Name Loc -Value $Local 
    $RemoteTIme | Add-Member -MemberType 'NoteProperty' -Name Del -Value $Delhi 
    $RemoteTIme | Add-Member -MemberType 'NoteProperty' -Name Dub -Value $Dubai 
    $RemoteTIme | Add-Member -MemberType 'NoteProperty' -Name Sin -Value $Singa 
    $RemoteTIme | Add-Member -MemberType 'NoteProperty' -Name Man -Value $Manch 
 
# Display the Output to the console. 
$RemoteTIme | ft * -AutoSize 
 
## End of the Script ##  
 
##########################-| a m a n    d h a l l y |-#########################

以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。

如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。

猜你在找的Shell相关文章