Probleme avec la date (how to display day of the week; e.g. Monday, Tuesday etc.)

hi everyone anyone know how i can see the date not only in numbers (example 11/01/2021) but also in letters (example monday 11/01/2021) in my application i need the day in letters thank you

Use the format date/time block in the clock component

How to format:

https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

1 Like

One of several possible ways:

2 Likes

thanks it works but the result is (Mon) there is a way to have (Monday)

Yes. You have to do more work.

There are several ways. One involves using If..then statements, if Mon replace Mon with Monday using Blocks

or use a modification of Taifun's day of year example https://puravidaapps.com/snippets.php#2dayofyear and parse

as shown here.

1 Like

Tim's link has the secret:

Pattern letters are usually repeated, as their number determines the exact presentation:

  • Text: For formatting, if the number of pattern letters is 4 or more, the full form is used; otherwise a short or abbreviated form is used if available. For parsing, both forms are accepted, independent of the number of pattern letters.

So I would try format EEEE instead of just E.
(I have not tried this yet).

1 Like

I did try EEEE and it produces Monday. What it does not do is produce Lundi which the other suggestions can do by using an appropriate dayOfWeekList. :slight_smile: or If .. then where if Mon then Lundi.

Pardon me, I misunderstood the scope of the initial post.
I usually have the sense to avoid cross-language communication.

Could you try writing some code to produce the days of the week in the required language using an if then statement?

It would be better to edit the source code (MIT) to identify the locale of the app/device, then the SimpleDateFormat return would show in the language of the locale.

perhaps something like this

What you actually do depends on what the required language is and what the language of the device is
(see Tim's post)

using List of the days of the week in the appropriate language and a TextBox to pick the language like perhaps

or using dozens of other techniques that could produce similar results.

1 Like

depending on what the developer wants to do and whether the display should be in English or another language . :slight_smile: The developer gets to decide.

1 Like

What is wrong with this one?

In my country, or better on my phone, I live in the Netherlands, the result is maandag, which is Monday in English.

4 Likes

thank you very much i tried and (EEEE) and it works

1 Like

Of couse nothing :wink: :