How to make an app - Andromo App Maker

Announcement

Collapse
No announcement yet.

Display day of week in text format - Mon, Tue, Wed ect

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Display day of week in text format - Mon, Tue, Wed ect

    please see my attempt

    What am I missing

    input1 = System.GetTime(TIME_FMT_MIL);
    Input.SetText("Input1", input1);
    input2 = System.GetDate(1);
    Input.SetText("Input2", input2);
    input3 = System.GetDate(7);

    input4 = (input3-1)

    Input.SetText("Input3", input4);

    Page.StartTimer(1000, 10);

    Phil M

  • #2
    Try this:

    Code:
    input1 = System.GetTime(TIME_FMT_MIL);
    Input.SetText("Input1", input1);
    input2 = System.GetDate(DATE_FMT_EUROPE);
    Input.SetText("Input2", input2);
    tWeekdays = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
    input4 = tWeekdays[tonumber(System.GetDate(DATE_FMT_DAYOFWEEK))];
    Input.SetText("Input3", input4);
    Ulrich

    Comment


    • #3
      Or, you can just use native Lua (which IMO is a little cleaner):

      Code:
      sTime = os.date("%X");
      sDate = os.date("%x");
      sDay = os.date("%A");
      
      Input.SetText("Input1", sTime);
      Input.SetText("Input2", sDate);
      Input.SetText("Input3", sDay);

      And here's a list of native Lua time/date tags (to manipulate outcomes):

      Source: https://www.lua.org/pil/22.1.html

      Comment

      Working...
      X