Format Date and Time in Canvas App

How to format date and time in canvas app.

High level resolution steps

    • Here I’m taking example where I have one label that contain current date and time, but I only
      want to show the date.

    Detailed resolution steps

    Step 1: I have added one label that is “Date” label and another label which is showing the current
    date and time.

    Step 2: For showing current date and time, you can use the below formula on the “Text” property for
    “Label1”.

    Text property of Label1:
    Text(Now(), “[$-en-US]yyyy-mm-dd hh:mm:ss AM/PM”)

      Step 3: Now placed another label “Label2” in which you want to show the formatted date. And add the below formula.

      Text property of label2:
      Text(Day(DateValue(Label1.Text)), “00”) & “-” &
      Text(Month(DateValue(Label1.Text)), “00”) & “-” &
      Text(Year(DateValue(Label1.Text)), “0000”)

      Output:

      In the below screen we can see the output where one label contains date and time and second one
      contains formatted date.