similar to: european date format

Displaying 20 results from an estimated 1000 matches similar to: "european date format"

2006 Jun 15
4
parse only seem to understand US date format
I''ve tried Time.parse() and DateTime.parse() but they interpret the date as US format. Is there any way to tell it to interpret as dd/mm/yyyy? -- Posted via http://www.ruby-forum.com/.
2009 Jun 15
1
calendardateselect problem
I am using http://code.google.com/p/calendardateselect/ for my date time picker. I am using dd.mm.yyyy format (:finnish) and i am using ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge! (:default => "%d.%m.%Y") ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge! (:default => "%d.%m.%Y %H:%M") in my enviroment. Everything is working
2006 Mar 23
5
Custom date format
Hi, I''ve followed these directions : http://railswiki.pdxruby.org/HowToDefineYourOwnDateFormat.html It seems pretty straightforward but obviously it doesn''t work for me... article.date_edited.to_formatted_s(:my_format_1) produce a default formatted date, not the one I''ve defined in environment.rb : ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(
2006 Mar 14
21
Changing default date format in Rails
I''ve spent all day digging through the rails api and postgres-pr on this, I think it''s time to ask the list. Postgres stores a Date in YYYY-MM-DD format. My users want the dates in MM/DD/YYYY format. Sure, I could explicitly convert it on the app level every place where a date is displayed, but that seemed like a DRY violation. I thought I''d be clever and simply
2006 May 11
4
string to date/time?
Hey All, Anyone know of a library for parsing "human" dates, like "this friday" or "2 days ago"? I used to use strtotime in php, but starting from here; http://wiki.rubyonrails.com/rails/pages/PhpStrtotime and doing lots of googling, I haven''t been able to find anything similar for ruby. I know of javascript solutions to this, but I''d need to do
2006 Jun 14
5
display formatted date
Hi, In my form I have date field set as ''datetime_select'' which is fine as I wanted it in the same format. But while displaying (list action) it displays date in long format i.e. ''Tue May 30 15:39:00 Central Daylight Time 2006''. How can I format it so that it will just be diaplyed as ''dd/mm/yyyy'' format? Thanks -- Posted via
2006 Oct 09
1
error running 'ruby script/console' => "uninitialized constant RAILS_ROOT" ??
Hi, Anyone suggest why when I try to run the console via ''ruby script/console'' I get the following "uninitialized constant RAILS_ROOT" ?? Error: ================================ V:\Source\testapp>ruby script\console Loading development environment. ./script/../config/../config/environment.rb:3:NameError: uninitialized constant RAILS_ROOT
2006 Jan 07
1
How to DRY with Fixtures (helper or extend Time class, how)?
I have a test/fixtures/users.yml like so: apa: id: 1 username: apa [...] created_at: <%=Time.now.strftime("%Y-%m-%d %H:%M:%S")%> updated_at: <%=Time.now.strftime("%Y-%m-%d %H:%M:%S")%> I don''t like how I''m repeating myself with the strftime bit. Is there some shorter Time method to format time for a (MySQL) datetime field that
2006 Apr 13
5
Changing class data in environmrnt.rb
Greetings, I have a class that should allow you define some default values. It seems to make the most sense to do this environment.rb since its the default app configuration. It currently looks like this: Settings::DEFAULT_VALUES.merge!({ :setting_one => ''foo'', :settings_two => ''bar'' }) The problem is in development mode, the values are only
2006 Jul 10
2
Formatting of dates in a text_field
When displaying a date field using a text_field object, is it possible to specify how the date will be formatted? <%= text_field ''item'', ''created_at'', {:class=>"text-input", :size=>18, :disabled=> true} produces 2006-07-07 12:00:00 I would like to reformat it to something like 07/07/2006 12:00pm -- Posted via
2010 Aug 13
4
Rails and Oracle - can select date but cannot save
I''m seeing a behavior in Rails that I find very strange. Having worked quite a bit with Oracle with other languages I would always dutifully do ALTER SESSION SET NLS_DATE_FORMAT = <my_date_format> and ensure I use that date format in my application. With Rails I still have not figured out how to execute an ALTER SESSION statement after connecting to the database (I''m using
2011 Feb 04
5
Date parse - month and day reversed
I am getting the month and day reversed in parsing a date. I am wondering if there is some intelligence in Ruby that knows that at the moment I am in Mexico, as the parsing is working as if I was "6/15/2008".to_date => ArgumentError: invalid date "15/6/2008".to_date => Sun, 15 Jun 2008 What I really want is my date to be understood as month/day/year. Is there a way to
2007 Nov 02
0
DATE_FORMATS and functional tests
I have the following in my environments.rb file: my_formats = { :msc => ''%d %b %Y %I:%M %p'', :msc_short => ''%d %b %Y'' } ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge! (my_formats) ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge! (my_formats) With this, things like
2006 May 21
5
model methods
Hello everyone, In my model, I have def leave_at_formatted leave_at.strftime("%I:%M %p") end I was wondering if there were any way to define to_s for leave_at in order to get the same result? Thanks!
2006 Apr 04
11
Date/Time format and syntax
Hi, Just wondering how I get both the current date and time to display here (so far I can only get the date OR the time): @tblregisteredphone.txtregisterdatetime = Date.today Also, how can I change the format of the date and time from: Tue Apr 04 00:00:00 GMT Daylight Time 2006 to 2006-04-04 12:04:00 ?? I''m sure it''s very simple, I just don''t know how
2005 Sep 06
1
US Date Handling in Rails
My application is built on Rails and MySQL. It will only be accepting US formatted dates as input, however both Rails and MySQL are oriented around ISO the format. I know I can convert a good portion of the entries using ParseDate::parsedate but it does not appear this is how the conversion is taking place when data is being transferred from the params hash into model members. Say I have a field
2006 Jun 14
3
How to use at_beginning_of_year
I want to get the Date in formation YYYY-MM-DD for the start of the current year But I cannot think how to do it... This generates a name error .rhtml view. <%= at_beginning_of_year.Time.now %> -- Posted via http://www.ruby-forum.com/.
2006 Jul 31
2
is it possible to make to_xml use underscore instead of dash?
Hi all, I am getting ActiveRecord to produce XML with render :xml => @user.to_xml However, on the client end it is a bit annoying for me to deal with attributes like first-name. I would much rather have first_name. Is there any way for me to turn off the behavior of converting _ to -? This seems to be done by a call to dasherize inside the to_xml of
2006 Jan 23
3
date.to_s trimming
When I convert a datetime to a string, it prints out something like this Jan 20 12:00:00 EST 2006 I want to trim off the last twelve characters, i.e. :00 EST 2006 I tried to do it like so: @date = @meeting.date.to_s.chomp.chomp.chomp.chomp.chomp.chomp.chomp.chomp.chomp.chomp.chomp.chomp but the chomps seem to do nothing. I''d love to use regex, but I don''t know which
2009 Feb 20
3
Years gone by (deprecation of years method)
Can anyone give me some insight as to why the ActiveSupport::CoreExtensions::Float::Time method ''years'' is being deprecated? I have an application managing contracts and being able to manipulate and report on them based on the number of years the contract lasts, is very convenient. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~