zoukankan      html  css  js  c++  java
  • 如何讀取Server端的時間區域設定

    An alternative is to write a function to display the server's time zone name
    dynamically instead of your hard-coded "GMT".  The server time zone name can
    be obtained from the server's windows registry.  You may use "VB" or "SQL"
    to read the registry value.  The key location is
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\Stan
    dardName.

    The following is an example of using SQL:
    declare @TimeZoneName varchar(30)
    exec master.dbo.xp_regread
    'HKEY_LOCAL_MACHINE','SYSTEM\CurrentControlSet\Control\TimeZoneInformation',
    'StandardName', @TimeZoneName OUT
    select @TimeZoneName

    However, it may be easier to use VB script to read the registry value.
    Set WshShell = Server.CreateObject("WScript.Shell")
    strValue=WshShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contr
    ol\TimeZoneInformation\StandardName")
    Set WshShell = nothing

  • 相关阅读:
    蟠桃记
    考新郎
    有假币
    年会抽奖
    发邮件
    进制回文数
    数位和
    外星人的语言
    一的个数
    继承
  • 原文地址:https://www.cnblogs.com/dimg/p/424444.html
Copyright © 2011-2022 走看看