Format a date in year, month day

One final (yeah, right… :-D) question.

I have been trying to get a date time formatted in years, months, day

I have used “YYYY-MM-DD”

I get the year and month ok, but my date isn’t showing properly.

I’ve tried all of the variable combinations that make sense from this url

https://www.unicode.org/reports/tr35/tr35-57/tr35-dates.html#Date_Field_Symbol_Table

but nothing seems to work.

Help?

Update: Never mind, I found it. For the help of others and me in the future, this format works

YYYY-MMM-dd

Regards

Can you share how are you using the format pattern?

I see one line of the documentation with that link but no example on how to use it for dates.

Thank you.

Hi AlbertoD.

I found the answer and did an update. I didn’t find it in that url either, but what I found by trial and error works. See my update.

Thank you for the response.

Regards

Thank you but I want to know the Xojo code that you use with that pattern.

Are you using:

string = format(date, "YYYY-MMM-dd")

or

string = date.ToString("YYYY-MMM-dd")

or something else?

I’m sorry but I can’t find in the docs how to use the format pattern.

Edit: I guess is the second one. Thanks. I don’t see an example or a reference to it on the documentation.

Isn’t that just SQLDate? Or are you looking for something else?

I think Michael wants: 4 numbers for year - 3 letters for month - 2 numbers for day