Date.today.strftime("%A").

  • Thread starter Ramsees Rastafa
  • Start date
R

Ramsees Rastafa

Date.today.strftime("%A") returns "Monday", what can I do to get "Lunes"
(in spanish).

Im using Windows 7 with Ruby 1.9.2, my regional settings are set to
"Spanish Mexico".

Thank you.
 
H

Harry Kakueki

Date.today.strftime("%A") returns "Monday", what can I do to get "Lunes"
(in spanish).

Im using Windows 7 with Ruby 1.9.2, my regional settings are set to
"Spanish Mexico".

Thank you.

If nothing better comes along, you could try something like this.

require 'date'
h = {"Monday" => "Lunes","Tuesday" => "Martes","Sunday" => "Domingo"}
p h[Date.today.strftime("%A")]


Harry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top