Discover our Clipsal Smart Home packages as seen on the Block

in location

OR

I'm looking for

  • Wholesalers
    • Uncheck All Check All
  • EXPERTISE
    • Expand
    • Expand
    • Expand
    • Uncheck All Check All
  • Switchboard Manufacturers
    • Uncheck All Check All
OR

The best way to see what Clipsal electric products can do for your home is seeing them in action at a Clipsal Display Centre.

Product stock may vary according to location. If you're after a specific product range, please check with your chosen location before visiting.

10 Results
    Load More Load Complete
    Change Location

    In Vijeo Designer, how do we record the date and time to a variable when a button is pressed?

    To record the date and time when a button is pressed, you will need to create a script in that button that copies the system variables _Hours, _Minutes, _Seconds, _Year2, _Month, _Day to a string variable for time and a string variable for date.

    Please see the example script below:

    //-------------------------------------
    //Script Created: Jan 25, 2016
    //
    // Description:
    //
    //-------------------------------------

    // Replace this line with your script
    String YearYY = _Year2.getStringValue();
    String MonthMM = _Month.getStringValue();
    String DayDD = _Day.getStringValue();

    if(_Month.getIntValue() < 10)
    {
        MonthMM = "0" + _Month.getStringValue();
    }

    if(_Day.getIntValue() < 10)
    {
        DayDD = "0" + _Day.getStringValue();
    }


    DateString.write(YearYY + "/" + MonthMM + "/" + DayDD);

    String HoursHH = _Hour.getStringValue();
    String MinutesMM = _Minutes.getStringValue();
    String SecondsSS = _Seconds.getStringValue();

    if(_Seconds.getIntValue() < 10)
    {
        SecondsSS = "0" + _Seconds.getStringValue();
    }


    if(_Hour.getIntValue() > 11)
    {
        temp.write(_Hour.getIntValue() - 12);
        HoursHH = temp.getStringValue();
        TimeString.write(HoursHH + ":" + MinutesMM + ":" + SecondsSS + " pm");
    }
    else
    {
        TimeString.write(HoursHH + ":" + MinutesMM + ":" + SecondsSS + " am");
    }




     

    Didn’t find what you were looking for?

    Try Searching Again View Our Categories

    Need further assistance?

    Our Customer Care department provides total customer service solutions for our residential, industrial and commercial applications.

    Get Assistance