Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Date.today.strftime("%A").

Reply
Thread Tools

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

 
 
Ramsees Rastafa
Guest
Posts: n/a
 
      02-01-2011
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.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Harry Kakueki
Guest
Posts: n/a
 
      02-01-2011
On Tue, Feb 1, 2011 at 10:04 AM, Ramsees Rastafa <(E-Mail Removed)> wrote:
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments