Displaying 11 results from an estimated 11 matches for "to_formatted_s".
2006 Jan 24
0
to_formatted_s(:rfc822) doesn''t work
I do ''@item.datetime.to_formatted_s(:rfc822)'' and it
outputs:
2003-08-06T04:12:00-0600
'':db'' doesn''t work either, but '':short'' does. How can
I output rfc822 without actually putting all that
awful % code in my templates? I''ve also tried this in
environment.rb, but it st...
2012 Jun 21
6
where do I report this DateTime bug?
...standalone file to demonstrate the bug, but the punch line is
that this code:
TestRecord.create!(:f_datetime => (expected = DateTime.jd(2000000)))
found = TestRecord.first.f_datetime
puts("expected == found => #{expected == found}")
puts("expected = #{expected.to_formatted_s(:rfc822)}")
puts("found = #{found.to_formatted_s(:rfc822)}")
generates this response:
expected == found => true
expected = Wed, 14 Sep 0763 00:00:00 +0000
found = Sat, 14 Sep 0763 00:00:00 +0000
So. The dates are equal, but was that day a Wednesday or a...
2006 Apr 24
3
TimeStamp conversion
Hi,
I''ve got a TimeStamp field in MySql and want to use the hour and minutes
in the value.
for example:
StartTime = Schedule.find(action2.ScheduleID).DateTimeStart.to_s
That returns "Mon Feb 20 08:00:00 Romance Standard Time 2006"
How do I get 08:00 returned ??
Thanks !
Steven.
--
Posted via http://www.ruby-forum.com/.
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!(
:my_format_1 => ''%d/%m/%Y - %H:%M'',
:my_format_2 => ''%l:%M %p, %B %d, %Y''
)...
2006 Jun 08
4
datetime fixture format for Mysql 5.0
Hi All:
I develop on several machines, most have Mysql 4.* and one has Mysql
5.0. On 4.*, the following erb for a fixture works fine:
updated_at: <%= 1.days.ago.to_s:db%>
But fails on 5.0. I had a similar deal when I had date fixtures, and
switched forrmats so that both 4.* and 5.0 were happy. is there
to_s:db_works_for_mysql_50() ? or similar?
Thanks
Forrest
2006 Jan 04
3
date conversion
I have the date saved in a database in the following format
''20060102170020''. How do I go about converting the date in the format of
January, 01, 1901? I searched all over and found something similiar
using ''to_formatted_s''. However I only found support for converting
month to a three letter format (e.g. ''Jan''). Is there an eaiser way?
Thanks.
--
Posted via http://www.ruby-forum.com/.
2006 Jan 16
8
AJAX + Table.
...=> @componentlogs
end
PARTIAL FORM
<tr>
<td><%=h componentlog.cl_spr %></td>
<td><%=h componentlog.cl_user %></td>
<td><%=h componentlog.cl_fromarea %></td>
<td><%=h componentlog.cl_date %> <%=h
componentlog.cl_date.to_formatted_s(:my_time) %></td>
<td><%=h componentlog.cl_status %></td>
</tr>
Any help would be seriously appreciated!
Thanks very much
--
Posted via http://www.ruby-forum.com/.
2006 Jun 30
0
storing dates from a date_select does not work
...tmfechanac]
"dtmfechainicio" => params[:usuario][:dtmfechainicio]
}
But it doesnt work I have tried
params[:usuario][:dtmfechanac].to_s .to_time but still no luck
I get this error
--
You have a nil object when you didn''t expect it!
The error occured while evaluating nil.to_formatted_s
--
but the date is being sent I see this in the same error page
Parameters: {"commit"=>"Ingresar Tomador",
"usuario"=>{"strtel1"=>"lkh", "strteltrabajo"=>"kj",
"strtel2"=>"jlkj", "strtel3&...
2007 Nov 14
1
New Foxy Fixtures (Rails 2) & STI (Single Table Inheritance)
...nt_type: application/zip
type: FileDownload
project: hemingway
now, in my versions.yml, I have:
alpha:
name: Alpha 1
revision: 2
description: this is the first alpha release for hemingway!
project: hemingway
file_download: hemingway_alpha_zip
created_at: <%= (Time.now - 5.days).to_formatted_s(:db) %>
The problem I''m having is that it''s trying to put file_download into a
column in versions when I run rake test:units
ActiveRecord::StatementInvalid: Mysql::Error: #42S22Unknown column
''file_download'' in ''field list'': INSERT INTO `ve...
2006 Mar 19
1
Question on creating a report
Hi,
I''ve got a little Rails app, and I wanted to generate a report from
some data. I did it one way, but it didn''t seem quite "Rails".
I created two methods in a controller, one called "report" that was empty:
def report
end
that would just then display the report.rhtml page. This page
contained a form tag with a text box and a submit button. This form
2008 Aug 25
2
maths not working (can't get this)
...39;', ''course_duration'', 1..52, { :include_blank => true
} ) %><br>
<%= submit_tag "Proceed to quotation" %>
<% end %>
------------
OUTPUT PAGE
<hr>
<h1><%= @course.name %></h1>
<hr>
<br>
<%= @time.to_formatted_s(:long_ordinal) %><br>
<br>
Price per week: <%= number_to_currency(@course.price_per_week, :unit =>
"£", :separator => ".", :delimiter => ",") %><br>
Duration: <%= @course.duration_in_weeks %> weeks<br>
Registrat...