Jump to content
  • CurDayOfWeek()

    CurDayOfWeek()

    VBScript   → Lua

     

    The function returns the current day of the week (1-7) according to the script user's location.

     

    Dim nDayOfWeek
    nDayOfWeek = CurDayOfWeek()

     

    or if being used directly within a GSE property dialog, e.g. in a Say Number block to directly announce the current day of the week (as a number) to the caller:

     

    image.png

     

     

    This function returns an integer value.

     

    The returned number evaluates to:

     

    • 1 - Monday
    • 2 - Tuesday
    • 3 - Wednesday
    • 4 - Thursday
    • 5 - Friday
    • 6 - Saturday
    • 7 - Sunday

     

    If you are interested in the name of the current day of the week (instead of the number) you can use the VBScript buildin function WeekdayName. In this case you need to know that the language the name is returned in is defined by the regional settings of the SwyxWare Service Account Windows user. Read more about this here.

     

    This function can be called at any time within the call routing script.

     

    The current date will be requested making use of the Server Script API function PBXUser.Now. This ensures that the location configuration (time zone) of the script user will be considered.

     

    Unlike the VBScript buildin function Weekday this function always starts with Monday as 1, regardless of any regional or location settings.

     

     


    Tom Wellige
     Share


     Share




×
×
  • 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.