Jump to content
  • CurTime()

    CurTime()

    VBScript   → Lua

     

    This function returns the current time according to the script user's location.

     

    Dim vTime
    vTime = CurTime()

     

    or if being used directly within a GSE property dialog, e.g. in a Say Time block to directly announce the current time to the caller:

     

    image.png

     

     

    This function returns a date / time value. The returned value does not contain any date information, unlike CurDateTime().

     

    Note:

     

    This function is not the same as the VBScript build in function Now.

     

    While Now returns the current date and time of the SwyxWare Service Account Windows User (according it's regional settings) when being used within a call routing script, CurTime() uses the Server Script API function PBXUser.Now to get the script user's date and time according to his location (timezone) configuration within SwyxWare. This is not necessarily the same.

     

    The SwyxWare Service Account is the Windows User the SwyxWare Services are running under. As call routing scripts are executed by the SwyxServer Service they use the SwyxWare Service Account configuration.

     

    If you prefer using the VBScript build in Now function in favour of CurTime() in multi-location environments spreaded over several time zones, you can use SetLocale to adjust the regional settings for the current script. This is just for the current instance of the script and is not permanent on the server.

     

    Example:

     

    Assuming you have a location in Germany and one in New Zealand. The server is located in Germany. Users from New Zealand are logged in via a direct VPN connection. The server uses a German operating system as also complete German regional settings. Before using Now you need to set the correct locale in order to receive the correct date / time for New Zealand:

     

    SetLocale = 5129  ' New Zealand
    Dim vDate
    vDate = Now

     

     




×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.