Date/time

Hey guys, whats up?

Is there any way to format “City, Day… Month… Year” using os.date
([fmt [, t]])? Eg.: “São Paulo, 14 de maio de 2014”

yes. google ‘lua format date time’, tap the first result, and you get all explanations there.

@erickyyamato Try this.


function setup()
    print("Sao Paulo,"..os.date(" %d of %B of %Y"))
end

@Dave1707 is there any way to translate month’s name to portuguese?

@erickyamato, I believe it will be in the language that your iPad is set to.

@erickyamato Here’s another way to do it.


function setup()
    mth={"Janeiro","Fevereiro","Marco","Abril","Maio","Junho",
        "Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"}
    dt=os.date("*t")
    print(string.format("Sao Paulo, %d of %s of %d",dt.day,mth[dt.month],dt.year))
end

@JakAttak , my iPad’s language is setted to Portuguese :confused:

@dave1707 thank you man!

@erikyamayo, interesting. I thought os.date pulled the data in the language and time zone of your iPad settings.

Me too @JakAttak, but os.date just get my time zone