Displaying 20 results from an estimated 20000 matches similar to: "Searching by datetime field with Rails"
2006 Jul 18
1
Auto-populating time portion of a datetime field from a form
I see that if I use the date_select helper in my view, then in the
generated page, my selects are named obj[datetime_field(1i)] (and 2i and
3i for the other parts). These auto-populate the date portion of my
datetime_field.
I have another datetime field that I''m presenting the time from and I
would like to use a similar scheme to autopopulate it. Currently, I''ve
used the
2010 Oct 13
10
Rails 2.3.8 - What happens to a datetime field between a form being submitted and the controller receiving the params
I currently have a model that simply contains one datetime field:
class CreateElectricityReadings < ActiveRecord::Migration
def self.up
create_table :clocks do |t|
t.datetime :time_keeper
t.timestamps
end
end
def self.down
drop_table :clocks
end
end
If I enter the date string "13/10/2010" into this field its showing up
in the controller as
2006 Dec 15
1
What's up with DATETIME and TIMESTAMP in Asterisk 1.4beta3 ?
Hello,
In Asterisk 1.4 beta 3, the UPGRADE.txt file says:
Variables:
* The builtin variables ${CALLERID}, ${CALLERIDNAME}, ${CALLERIDNUM},
${CALLERANI}, ${DNID}, ${RDNIS}, ${DATETIME}, ${TIMESTAMP},
${ACCOUNTCODE},
and ${LANGUAGE} have all been deprecated in favor of their related
dialplan
functions. You are encouraged to move towards the associated dialplan
function, as these
2001 Apr 09
1
syntax error in datetime.c (PR#901)
Full_Name: Naoki Takebayashi
Version: 1.2.2
OS: Linux, RedHat 7.0/alpha
Submission from: (NULL) (152.3.12.123)
With RedHat 7.0/alpha (gcc 2.96-69), I encountered following error:
gcc -I. -I../../src/include -I../../src/include -I/usr/local/include
-DHAVE_CONFIG_H -mieee -O2 -mieee -c datetime.c -o datetime.o
datetime.c: In function `do_systime':
datetime.c:306: parse error before `ans'
2008 Mar 20
4
Blank DateTime versus Nil DateTime
Hi!
These days I have been having trouble with a test that tried to test
DateTime functionality. I have discovered that a NULL DateTime is
auto-type casted to NIL by Rails.
My problem here is that I have a field :datetime and I want to allow
NULL datetimes but not wrong datetimes. With this validation if deadline
is wrong or if is is blank it returns true. How I can accomplish this?
protected
def
2005 Feb 19
0
[Error] Using validates_presence_of for datetime field causes parse error?
Hi Everyone -
I''ve got an odd sort of error when I try to use validates_presence_of
for a MySQL ''datetime'' field. Here''s the relevant portion of the table
definition:
mysql> describe student_surveys;
+---------------------+---------------------+------+-----
+---------------------+----------------+
| Field | Type | Null |
2005 Nov 20
1
mySQL 5.0 upgrade - incompatible DateTime format?
I''ve upgraded to mySQL 5.0, and it''s gone pretty smoothly except that on
DateTime.now doesn''t seem to return a value that mySQL likes any more,
as seen in the following exception:
Incorrect datetime value: ''2005-11-20T15:33:12-0800'' for column ''logged_at'' at row 1: UPDATE notes SET `due_on` = ''2005-11-20'',
2008 May 30
1
Is DateTime and Time interchangeable?
I have datetime (SQL) column in my DB, and I noticed whenever I
retrieve that column using ActiveRecord, it returns an object of class
Time instead of DateTime. Does Rails convert treat datetime and time
as if they''re the same?
Eric
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 May 10
3
migrations :timestamp becomes :datetime in mySql
For some reason whenever I try and create a timestamp column with
migrations and mysql I get a datetime column instead. That''s kind of
annoying because I want the column to update every time the row gets
changed. Is this a bug, or is there something I can do about it?
(Obviously I can manually change my mysql table, but that kind of
defeats the point of migrations!)
In my migration
2006 Jan 20
1
XMLRPC::DateTime from AWS
When I do an XMLRPC webservice call to retrieve a single Product, my
DateTime fields in the products table do not get converted to a valid
DateTime value, but remain as XMLRPC::DateTime structures.
So, say my webservice call is:
@product = @aws.get_product(1)
Then my @product object looks like this:
name: My product
last_updated: #<XMLRPC::DateTime:0x37c5338>
description: This is my
2009 Sep 18
4
Datetime conversion
I'm relatively new to R .I tried converting the datetime column with values
like 01apr1985:00:00:00.000 using strptime(datetime,"%d%b%Y).Could anyone
help me in this regard .Please reply ASAP i need .
--
View this message in context: http://www.nabble.com/Datetime-conversion-tp25503138p25503138.html
Sent from the R help mailing list archive at Nabble.com.
2006 Apr 25
1
DateTime problem in AWS
I am trying to implement a web service that returns a datetime stamp as
part of the structured object returned in the response. As noted in
another post (http://www.ruby-forum.com/topic/59762), there seems to be
a problem with the DateTime.parse method in that it does not match the
year. Is anyone aware of workaround for this issue?
My current idea (a hack, but it seems to work) is to
2006 Apr 05
3
how to insert Current DateTime value into database?
Hi,
I want to insert onto database the Current DateTime Value into database
field "Store_date" with datatype (DATETIME). How to do tihs?
I am usiing hidden variable into my form as follows:-
=======================
<%= hidden_field("store", "store_date", :value =>:datetime ) %>
=======================
But when I m submmittng form I couldn''t find
2009 Aug 18
1
Applying Logical statement to DateTime string as factor
R-Help
I have a data set which uses a DateTime string as follows : "2009-06-30
18:14:59"
While I have been able to convert to DateTime properly
time <- strptime(as.character(dat$Time),format='%d %b %Y %T') #Convert to
dateTime string
I would like to use the time of day "hour" as a *factor* level. I have
found that I can convert the date time to a factor
time
2006 Jun 18
4
uninitialized constant Datetime
I am building an application and I have generated the scaffold for a
product.
In the list method I include something like
my_date = Datetime.now
and the result I get from the webrick is an error
uninitialized constant Datetime
Do I have to add a line with a require?
I am new at ruby on rails
thanks in advance
--
Posted via http://www.ruby-forum.com/.
2007 Aug 07
0
Newbie: Want to use time_select to partial fill a datetime field
Hello
Our Database schema, and hence Our Model has a few datetime columns/
fields. But when entering new instances, We only want to present time
(i.e. HH:MM) in in our HTML views to the user. The time_select looks
useful, because it has an attractive minute_select: =>15, so the user
can enter 1/4 hours increments. The idea being that we would default
the Date part of Datetime attribute to
2006 Apr 25
2
DateTime format YYYY-MM-DDTHH:MM:SSZ ????
Hi all -
Implementing my first web service with rails and trying things out using
the "/controller/invoke" interface. Mostly works fine.
But I have a function that takes a datetime and returns all rows that are
newer than that. According to the log the SQL it''s generating is this:
SELECT * FROM xxxx WHERE (created_at >= ''2006-04-25T13:18:31Z'')
I have
2006 Jan 07
1
datetime returned as string, sometimes....
Hi,
I''m using postgresql 8.1, rails 1.0, and I have a strange problem on a
datetime field (timestamp without time zone in postgresql).
As shown below, the field "value" sometimes returns a string, and
sometimes a Time instance, depending of where the value is used....:
* breakpoint session _from inside an instance method_ of the object:
value
=> "1996-05-01
2005 Sep 22
1
ActiveRecord DateTime mapping
Hye,
I try to store DateTime as integer (seconds) in my database (MySQL).
I''d like to convert seconds to DateTime in the ActiveRecord object
to handle it easily in my views.
I try to play with callbacks or with method dedicated to my attributes for eg.
def fetched
upd = nil
v =read_attribute(:fetched)
if (v)
upd = DateTime.at(v)
else
upd = DateTime.now
end
end
def
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