show days of the week

Good,

I have a question about how to show the days of the week according to the day I am. That is, if today is Friday the 19th, when I display a list, it shows me the following: Saturday 20, Sunday 21, Monday 22, Tuesday 23. Thank you very much

Good to you as well! (couldn’t resist)

With questions like this, it is a good practice to try googling them first. If you search for “Corona SDK get date” one of the first links you find is https://docs.coronalabs.com/api/library/os/date.html and you’ll find your answers there. This is, however, also a Lua question, so you could also just google for “lua date” and you’d find the answers as well.

There are several ways of showing weekday name and number, the easiest perhaps being:

local date = os.date( "%A %d" ) -- %A = weekday name, %d = day of month as a number print( date )

If you want to create a list that expands into the future, you could use the table method and add a simple if else piece for naming the dates.

Can you share the code you’re working with and what timezone you’re in?
 

Rob

Good to you as well! (couldn’t resist)

With questions like this, it is a good practice to try googling them first. If you search for “Corona SDK get date” one of the first links you find is https://docs.coronalabs.com/api/library/os/date.html and you’ll find your answers there. This is, however, also a Lua question, so you could also just google for “lua date” and you’d find the answers as well.

There are several ways of showing weekday name and number, the easiest perhaps being:

local date = os.date( "%A %d" ) -- %A = weekday name, %d = day of month as a number print( date )

If you want to create a list that expands into the future, you could use the table method and add a simple if else piece for naming the dates.

Can you share the code you’re working with and what timezone you’re in?
 

Rob