similar to: String date parsing

Displaying 20 results from an estimated 9000 matches similar to: "String date parsing"

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 Jan 28
1
Method for returning a random date between two dates
Hi, I''m trying to create a method to return a random date within a range. So far, I''ve come up with this... require ''parsedate'' def random_date (a, b) adate = ParseDate.parsedate(a) bdate = ParseDate.parsedate(b) atime = Time.local(*adate) btime = Time.local(*bdate) atime + (rand * (atime - btime) ) end ...and it doesn''t seem to
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 May 21
3
Using ParseDate in for loop
Hi, I''m trying to use ParseDate within a for loop but I get this error: can''t dup NilClass Any suggestions for making this work? Thanks, -Jason
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/.
2005 Aug 04
0
Rails Date/Time Validation and Parsing
I''m kind of getting my brain around Rails''ey things. Dates are an annoyance no matter what the language, but in keeping with DRY, I''m looking for something like: validates_date :between => 4/8/2002..5/29/2009 Or something like that. Additionally, it seems someone somewhere must have created a wrapper around strtotime. What I''m looking for is a way to parse
2006 Jun 21
0
SQLServer Timestamp parsing problem in sqlserver_adapter.rb
So, I''ve used Rails to tie into a legacy system which is on SQL Server 2000 with a required timestamp field, DBTimeStamp. The field is defined in SQL Server as type timestamp, but when rails is pulling it in, it appears it may be casting to a datetime format. So, when I try to read or write to the field, it gives me a parsing error: NoMethodError: private method
2011 May 23
1
More relevance for recent documents
Good afternoon I would like to ask if is possible somehow give more relevance to the recent documents in search results. I dont want to sort results according to the date, I still prefer relevance, but I would like to see recent documents with better scoring. I was trying to add search query using AND_MAYBE, which should use relevance from both subqueries, but it didnt add any benefit to the
2006 Jul 17
2
european date format
hi, overhere users go nuts if they have to enter the date in iso format, so i have to make my applications in such a way that not only dates are displayed in the "dd-mm-yyy" format but also can be entered in that way. somewhere i found this code to put in the environment script: ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.update( :default => ''%d/%m/%Y
2006 Jul 26
8
change text_field_tag class
in my booking / _form I have the following input fields : (startdate and endate) <div> <label for="startdate">Booking Start Date</label><br /> <%= text_field_tag(''startdate'', @startdate, {:class => @startdateclass, :readonly => "readonly", :maxlength => "25"} ) %> <%= observe_field("startdate",
2019 Oct 16
2
BackupPC v4 from epel
Hello Everyone, Has anyone tried to install BackupPC v4 on CentOS 8 from epel? I just did and this happened: [root at resurrect ~]# dnf --enablerepo epel install BackupPC Last metadata expiration check: 0:18:41 ago on Tue 15 Oct 2019 08:03:59 PM EDT. Error: Problem: conflicting requests - nothing provides par2cmdline needed by BackupPC-4.3.1-2.el8.x86_64 - nothing provides
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
2015 Feb 20
2
sipsak 200 for a user, but 404 for a different user...why?
What's the difference between user "123" and "devries"? Based on the output here, they seem the same..? tleilax*CLI> tleilax*CLI> sip show users Username Secret Accountcode Def.Context ACL Forcerport 201 password 201 default No Yes 123
2006 Jun 05
3
How to get dd mmm and yyyy from dd-mmm-yyyy
The input values could be something like this: 01-Dec-2006 01-December-2006 1-June-2006 Is there an easy to way to get the three variables populated dd, mmm and yyyy for any of the above input values? I tried to look at regex but couldn'' anything simple. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Jan 20
1
Time From String
Is there any Ruby / Rails way to take a string and convert it to time? timefstr Specificallc,y I''d like to convert iso 8601 fromats to Ruby Time objects or ActiveRecord time fields. -- Posted via http://www.ruby-forum.com/.
2006 Jan 12
4
Typecasting and boolean attributes
I have 2 radio buttons like this: <%= radio_button ''group'', ''public'', true %> <%= radio_button ''group'', ''public'', false %> They hold the correct values when viewing the @group object. However, when updating, it does not appear that the params[:group][:public] value is being typecast correctly. As
2007 Mar 10
2
upgrading rails to 1.2.2 giving me mongrel errors
I''m working on upgrading to rails 1.2.2 from 1.1.6 and getting the mongrel error below in development mode. Now things seem to work fine with 1.1.6and 1.2.2 (in prod mode). Any ideas what might cause this? Googling gave me very little to work with. This was the closest thing i found http://dev.rubyonrails.org/ticket/6716 I''m running Ubuntu with mongrel 1.0.1 and fastthread
2009 Dec 08
0
Holiday Gift Perl Script for US Holiday Dummy Regressors
##### BEGIN CODE ###### #!/usr/bin/perl ###### # # --start, -s = The date you would like to start generating regressors #--end, -e = When to stop generating holiday regressros # --scope, -c = D, W for Daily or Weekly respectively (e.g. Does this week have a particular holiday) # --file, -f = Ummm where to write the output silly! # # **NOTE** The EOM holiday is "End of Month" for
2009 Dec 08
0
Opps Correct Version of Holiday Regressor Perl Script
Here is the correct version. The old version is the redirect only version of the script. ### BEGIN SCRIPT #### #!/usr/bin/perl ###### # --start, -s = The date you would like to start generating regressors #--end, -e = When to stop generating holiday regressros # --scope, -c = D, W for Daily or Weekly respectively (e.g. Does this week have a particular holiday) # --file, -f = Ummm where to write
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 |