Enter date and time from web browser

Forum Home Forums Understanding the Software Using Formulas Enter date and time from web browser

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #15528
    kcks66
    Participant

    Hi Mikhail,

    I wish to let user enter certain date and time from web browser. I created an output/calculated channel with output formula SetVal(1239, Cmd) and set format to Date and time.

    Somehow I got Command Cancel error.
    https://ibb.co/ZT35XKt

    Pls advice and thank you.

    • This topic was modified 3 weeks, 6 days ago by kcks66.
    #15530
    manjey73
    Participant

    With the Date and Time format, it is transmitted as a string, Cmd is not suitable here

    Input Script – Val()
    Output Script – GetStrDt(CmdDataStr) or GetStrDtToUtc(CmdDataStr)

    Script Table
    For Locale Time

    public double GetStrDt(string dt)
    {
    SetVal(CnlNum, EncodeDate(DateTime.Parse(dt)));
    return EncodeDate(DateTime.Parse(dt));
    }

    For UTC Time

    public double GetStrDtToUtc(string dt)
    {
    SetVal(CnlNum, EncodeDate(DateTime.Parse(dt).ToUniversalTime()));
    return EncodeDate(DateTime.Parse(dt).ToUniversalTime());
    }
    • This reply was modified 3 weeks, 6 days ago by manjey73.
    • This reply was modified 3 weeks, 6 days ago by manjey73.
    #15535
    kcks66
    Participant

    Hi manjey73,

    Got it to enter desired datetime from web browser now.
    Thank you.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.