From: Suraj Kurapati Date: 2008-01-09T07:21:37+09:00 Subject: Re: dow ruby's strftime not attempt POSIX-compliance? Jochen Hayek wrote: > Why is ruby's core class Time acting like this: > > $ env LC_ALL=fr_FR date '+%A' > mardi > $ env LC_ALL=fr_FR ruby -e 't = Time.now; puts t.strftime("%A")' > Tuesday > > I would actually like ruby to act like "date" and "obey" > to POSIX or whatever we are used to in the *IX world, > which in turn certainly uses libc's strftime. In Ruby 1.8.x, you need to use the external ruby-locale library to set the locale before you use any Date/Time functions (otherwise the output is always in English). See this post for an example: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/ > I heard rumour, that "this is the standard", > and "it must stay this way". It has been the "standard way" for 1.8.x, but I hope 1.9 fixes this. Does anyone know? -- Posted via http://www.ruby-forum.com/.