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. Advertisements

  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. Advertisements

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:
    564
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,776
    Michael Borgwardt
    May 30, 2004
  3. richard
    Replies:
    2
    Views:
    539
    richard
    Jan 13, 2006
  4. Gabriel Genellina
    Replies:
    2
    Views:
    873
    Simon Mullis
    Nov 12, 2010
  5. Vinnie Davidson

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

    Vinnie Davidson, Aug 13, 2005, in forum: ASP General
    Replies:
    6
    Views:
    567
    Aaron Bertrand [SQL Server MVP]
    Aug 15, 2005
  6. Florian Munz

    No localized strings in Date.strftime

    Florian Munz, Mar 26, 2005, in forum: Ruby
    Replies:
    0
    Views:
    149
    Florian Munz
    Mar 26, 2005
  7. rhubarb
    Replies:
    6
    Views:
    224
    Rover Rhubarb
    Apr 10, 2007
  8. joeyej
    Replies:
    7
    Views:
    367
    Randy Webb
    Apr 6, 2006
Loading...