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

Discussion in 'Ruby' started by Ramsees Rastafa, Feb 1, 2011.

  1. 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/.
     
    Ramsees Rastafa, Feb 1, 2011
    #1
    1. Advertising

  2. On Tue, Feb 1, 2011 at 10:04 AM, Ramsees Rastafa <> 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
     
    Harry Kakueki, Feb 1, 2011
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TB
    Replies:
    0
    Views:
    474
  2. Tim Golden
    Replies:
    0
    Views:
    563
    Tim Golden
    Oct 22, 2009
  3. D'Arcy J.M. Cain
    Replies:
    0
    Views:
    444
    D'Arcy J.M. Cain
    Oct 22, 2009
  4. Vinnie Davidson

    ASP Date: get records with date = today (SQL Server)

    Vinnie Davidson, Aug 13, 2005, in forum: ASP General
    Replies:
    6
    Views:
    346
    Aaron Bertrand [SQL Server MVP]
    Aug 15, 2005
  5. joeyej
    Replies:
    7
    Views:
    165
    Randy Webb
    Apr 6, 2006
Loading...

Share This Page