Displaying 20 results from an estimated 400 matches similar to: "Date.new.to_time.to_i"
2010 Nov 12
1
Dashboard throwing undefined method `to_time' for nil:NilClass error on page view
Using 1.0.4 release on Solaris 10 with Ruby 1.8.7.
Starting the server in production mode works fine until I request a
page from the web browser then I get the following errors on the
console. I''m running as user puppet (have also tried as user root but
same output). All files are owned by user/group puppet/puppet.
I have dropped and recreated the database multiple times just to see
if
2008 Jun 08
20
how to parse a "dd/mm/yyyy" formatted date string???
Hi,
I''m stuck. How do you parse a "dd/mm/yyyy" formatted date string???
I get a date format error.
Thanks in advance
Greg
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2008 Dec 06
9
jQuery Rails Functions
Hi,
I was wondering if anybody who used jQuery with rails could help me
out. I have a droppable that fires a simple function, shown below:
$("#list").droppable({
accept: ".item",
hoverClass: ''droppable-hover'',
drop: function(ev, ui) {
$(this).append("<br>Dropped!");
}
});
But how could I get this to fire a Rails funciton in the
2007 May 05
0
to_time "time out of range"
Hello,
I''m experiencing some inconsistent results between code I run in the
console and in my test/project code.
On the console this works...
>> Date.new(1899, 12, 25).to_time
=> Fri Dec 13 14:45:52 CST 1901
>> Date.new(2058, 12, 25).to_time
=> Mon Jan 18 21:14:07 CST 2038
The values are changed to their min and max values.
If I do the same in my test or development
2007 Feb 21
2
date helper bug?
I''ve found an issue when trying to use the time_ago_in_words and
distance_of_time_in_words from action view''s date_helper.rb
Using SQL Server, I have a datetime column that gets returned as:
"2007/02/21 09:54:00". When I pass this to time_ago_in_words (which
just passes on to distance_of_time_in_words) it miscalculates the
difference as "9 hours" (...um yeah,
2006 Jun 12
3
compare Date with TIme
Hi
When returning data from a database column set as a date field I get
''2006-06-06''
I am then have these two lines of code in my controller, taht gain the
date I require.
pNow = Time.now
@pDate = Time.local(pNow.year, pNow.month, 1)
At the monment one is set to a date data type while one is set to a Time
data type.
how can i change these to be the same data type so i can
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
2009 Jun 08
4
how can i get attribute values from xml using libxml
Hi ,
i have xml document like this
<?xml version="1.0" encoding="ISO-8859-9"?>
<Root><Stk Category="601" Group="60101"
Brand="001">....................
then i have to use Category attribute but reader class couldnt
recognize attributes
when i use these codes below for testing;
while reader.read
puts reader.node_type
end
2007 Dec 12
6
Add a month to a Date object
Howdy all,
This may be the dumbest question in the world, but how can you "add
one month" to a Date object? I can''t just add 30 days, because months
have varying lengths.
Any help would be much appreciated...
Thanks!
-Neal
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
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
2006 Aug 06
1
How to query with calculations?
Hi,
I would like to do something simple yet I''m confused.
Lets say I have a table with 2 fields: rank, updated_at.
I would like to show all records matching this condition:
rank = rank ? (Time.now.to_time ? Updated_at.to_time)
As you can see this is supposed to be a calculation on the field.
How do I write a query to show this?
I''ve tried with_scope, and regular find but did not
2006 May 24
0
distance_of_time_in_german_words
Hiall,
This could be useful for those of you producing websites in the german
language. Basically I copied the definition of the rails builtin
distance_of_time_in_words and extracted another method
german_words_for_distance_in_seconds. Just put these e.g. into module
ApplicationHelper and you can use it in all views.
def distance_of_time_in_german_words(from_time, to_time = 0,
include_seconds
2007 Apr 26
1
libcrypto.so: undefined reference to `utc_time'
I am trying to cross compile openssh for arm5b-jungo-gnu-gcc,,
and also using openssl and zlib from same compiler arm5b-jungo-gnu-gcc
but i am getting following error,,,
/usr/local/openrg/armv5b-jungo-linux-gnu/bin/armv5b-jungo-linux-gnu-ld: warning: cannot find entry symbol _start; defaulting to 0000b9c8
/usr/local/openrg/armv5b-jungo-linux-gnu/bin/../armv5b-jungo-linux-gnu/lib/libcrypto.so:
2006 May 16
10
Date verus Time class
I''m using the date_select and datetime_select helpers in my view, and
they return Date classes from the params hash.
But how do I work with Date classes, they don''t print human readable
dates or times, Time classes work well I can use strftime("%H:%M") to
print to the screen.
Is it possible to convert a Date to a Time, Ive been tinkering in irb
but have got
2008 Jun 14
0
Bug and patch for vpim-0.619
On Sat, Jun 14, 2008 at 10:42 AM, Christopher J. Bottaro
<cjbottaro at alumni.cs.utexas.edu> wrote:
> I noticed two little bugs when using your vpim module in a Rails application.
>
> 1) The vpim module overwrites Rail''s implementation of Date#to_time.
> 2) The vpim module''s implementation of Date#to_time causes
> Date.today.to_time to return a Time that is
2007 Sep 24
3
Oracle Date + RoR
Hi Experts,
I''ve a model called Product where i''ve column called created_at,
updated_at
where i''ve made a query based on Oracle date format
like
date_of_created = ''23-SEP-07''
@product = Product.find(:all, :conditions => ["created_at=?",
date_of_created])
but in view its empty.
AND EXPERTS I''VE DATA WITH 24-SEP-07 FOR MORE
2006 Oct 19
3
Selecting datetime values from SQL Server (year < 1970)
All,
Rails 1.1.6.
Any AR find() call that generates a SELECT * type query against a table
with a DATETIME column in SQL Server whose value occurs before 1970 will
fail, because of the coercion of SQL Server datetime types to Time
values in Ruby.
See sqlserver_adapter.rb line 490
(record[col] = record[col].to_time if record[col].is_a? DBI::Timestamp)
If I remove the coercion (just commenting
2006 Jan 22
8
Date Calculation
I am trying to calculate the number of days between 2 dates using
Time.now - object.date where object.date is a date pulled from a
database. I want to display the age of the entry in the database in
days. I keep getting an error about not being able to convert a date
into a float. What am I doing wrong. If I use object.date -
object.date it seems to work but the answer is useless (0). I
2009 Jul 28
6
how to set smpt server for our rails applicaion
hi i am using technoweenie-restful-authentication plug-in for
authentication in my application. i want to send a activation link to
the user''s mail-id.
for that i need to set the smpt server for our rails application, for
that i added the follwing code in config/environment.rb file
ActionMailer::Base.delivery_method:smpt
ActionMailer::Base.smpt_settings = {
:address =>
2008 May 03
11
Date comparisons
I occasionally get this error:
1)
''A puzzle once featured, should no longer be nominated'' FAILED
expected: Sun May 04 09:10:26 -0700 2008,
got: Sun May 04 09:10:26 -0700 2008 (using ==)
./spec/models/puzzle_spec.rb:180:
So, the dates looks the same to me. Any ideas for how to debug?
Joe