Appsheet TODAY() formatting

I have an issue with the way AppSheet formats a date with the TODAY() function.

I use TODAY() in a workflow in order to create a new folder based on the current day, in OneDrive. Here, OneDrive seems to format the date automatically to DD-MM-YYYY i.e. 24-02-2020. This is fine.
I also use TODAY() to create a filepath to the same folder, but as this is stored in the spreadsheet AppSheet seems to work with (D)D.(M)M.YYYY i.e. 24.2.2020.

I fixed the dots by using SUBSTITUTE to replace dots with dashes but then I still get 24-2-2020, when I need it to be 24-02-2020. I guess I could use SUBSTITUTE() for this as well, but then Iโ€™d have to make a case for all the days and months where I need to add a 0, no?
The spreadsheet is in Excel, but the formatting doesnโ€™t seem to happen on the spreadsheet level, at least not at a quick glance.

Any help is appreciated!

Solved Solved
1 7 2,274
1 ACCEPTED SOLUTION

Bahbus
New Member

I believe default date formatting is for AppSheet is determined by the locale of the device, and thatโ€™s it. But luckily for you, you can just wrap TODAY() in a TEXT() formatting.

TEXT(TODAY(),"DD-MM-YYYY")

View solution in original post

7 REPLIES 7

Bahbus
New Member

I believe default date formatting is for AppSheet is determined by the locale of the device, and thatโ€™s it. But luckily for you, you can just wrap TODAY() in a TEXT() formatting.

TEXT(TODAY(),"DD-MM-YYYY")

Steve
Platinum 4
Platinum 4

As @Bahbus notes, locales play a big role in how dates are presented. I agree with him that your best bet is to wrap TODAY() with TEXT() to generate a date in exactly the format you want.

Also, if you would like to show text for the month (e.g. โ€œFEBโ€ instead of โ€œ2โ€) check out the following:

INDEX(
  {
    "January", "February", "March",
    "April", "May", "June",
    "July", "August", "September",
    "October", "November", "December"
  },
  MONTH(TODAY())
)

This could be enclosed in a CONCATENATE() expression. You can even use IF() to format the date differently, depending what other values will be shown with it.

Or also TEXT(TODAY(),"MMMM")

Thanks! I had missed that. Good to know!

The โ€œindexโ€ and โ€œconcatenateโ€ approach has the advantage of making it possible to accommodate just about any language (as far as I know, at least) without depending on existing formats. Hereโ€™s something I just did on my app:

2X_7_7506294b7ff636b67bc223f7493b16dfec0dcc47.png
2X_f_f4105e8807fdee6d48a50f194877ae2adb97d84e.png
2X_0_08d7f5662a13d5d7f651a0156e0c5874a6c57a36.png
2X_e_e76944b09945f4433348839b59fb99702ccb61d2.png

Just where?- In which field it should be written to be right. -In โ€œApp formulaโ€ field?, -โ€œInitial valueโ€? -โ€œSuggested valueโ€? . In these fields it shows error. Sowhere else?

Hi! Iโ€™m not sure I know what you mean but I usually make a virtual text column and then format the date there.

Top Labels in this Space