Displaying 20 results from an estimated 2000 matches similar to: "compare Date with TIme"
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:
2009 Mar 14
2
Format about Date and time
I have a data set like this:
> head(FormatedData)
ID Target Actual Date Time
1 2030 0 -57.0 12/20/08 17:03:00
2 2030 90 90.0 12/20/08 18:41:00
3 2030 45 43.8 12/21/08 14:36:00
4 2030 0 -23.8 12/21/08 19:30:00
5 2030 90 90.2 12/21/08 21:48:00
6 2030 45 48.6 12/22/08 13:02:00
I wan to convert the format of Date and Time, so I did this:
pdate
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
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
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
2009 Jun 18
3
Date.new.to_time.to_i
What''s going on here!?
>> Date.new.to_time.to_i
NoMethodError: undefined method `to_i'' for Mon, 01 Jan -4712 00:00:00
-0800:DateTime
from (irb):25
>> Date.today.to_time.to_i
=> 1245308400
>> RUBY_VERSION
=> "1.8.7"
>> Rails.version
=> "2.1.1"
(I''m not sure if this is a rails thing, or just a ruby thing)
--
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
2006 Mar 01
3
Convert Date to Time
Hi,
How do i convert a Date to a Time??
I have a date returned from sql and i need to be able to use handy
functions like next_week or beggining of week.
Any help appreciated
Thanks,
Chris
--
Posted via http://www.ruby-forum.com/.
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 Jun 13
17
reconstituting a date
In my view code, I have <%= datetime_select "in_out", "time_in" %>
which returns in params
:in_out: !map:HashWithIndifferentAccess
time_in(1i): "2006"
time_in(2i): "6"
time_in(3i): "12"
time_in(4i): "20"
time_in(5i): "24"
and I want to save that datetime to a column in the db...
if
2005 Dec 27
3
created_on & updated_on - helper to display date only
All,
My initial list is rather busy. I would like to shorten the
created_on and updated_on fields to just display the date, not the
time. Best wold be a simple 12/28/05 type of presentation.
I''ve found the format helpers in rdoc. (ie.
distance_of_time_in_words_to_now ), but none seem to be what I''m
looking for.
How do I control the date format of a timestamp field?
Thanks
2006 Jan 16
8
[newbie] This Month / Next Month / The One After That
What I want to do is simple.
I''d like code that prints out the name of this month (January) the next
month (February) and the one after that (March)
I''ve been able to print this month:
<% t = Time.now %>
<%= t.strftime(" This Month is: %B") %>
But I can''t figure out how to get the next months to print out!
--
Posted via
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
2018 Apr 15
4
Adding a new conditional column to a list of dataframes
Hi all ..,
I have a list of 7000 dataframes with similar column headers and I wanted to add a new column to each dataframe based on a certain condition which is the same for all dataframes.
When I extract one dataframe and apply my code it works very well as follows :-
First suppose this is my first dataframe in the list
> OneDF <- Mylist[[1]]
> OneDF
ID Pdate
2018 Apr 15
0
Adding a new conditional column to a list of dataframes
> On Apr 15, 2018, at 4:08 AM, Allaisone 1 <Allaisone1 at hotmail.com> wrote:
>
>
> Hi all ..,
>
>
> I have a list of 7000 dataframes with similar column headers and I wanted to add a new column to each dataframe based on a certain condition which is the same for all dataframes.
>
>
> When I extract one dataframe and apply my code it works very well as
2005 Jan 01
1
Re: vpim: bug in icalendar.rb, Icalendar#decode_status
Thanks for the bug report!
I''ll get a new release out next week, I''ve been on vacation for a few
weeks and I''m just getting up to speed with being back in a city.
In the meantime, the fix is to apply the following patch (in
Icalendar.decode_duration). I''ve also integrated your tests, thanks.
Cheers,
Sam
diff -u -r1.22 icalendar.rb
--- vpim/icalendar.rb 17
2006 Aug 10
3
Ruby on Rails with Oracle
Hello everyone,
I am trying to convince my colleagues to convert to Ruby on Rails,
however I am up against the following problem:
Ruby on rails seems to be primarily designed a single database doing a
small number of queries. While trying to process a webpage that does
thousands of sql queries on Oracle, I get the message that I have used
up too many cursors.
In Java, I can use stmt.close()
2013 Jul 18
2
Puppetlabs Apt module: dependency cycle
Using ```puppetlabs/apt``` in a puppet provisioner for vagrant. the
module is installed in puppet/modules and I''m getting a strange Dependency
cycle error.
the code in the manifest file:
# Run apt-get update when anything beneath /etc/apt/ changes
#taken from
https://blog.kumina.nl/2010/11/puppet-tipstricks-running-apt-get-update-only-when-needed/
exec { "apt-get
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
2009 Feb 04
4
Rails 2.2.2 to_date and to_datetime methods
In the console I see this behaviour:
>> "19270412000000".to_date.methods
=> ["ns?", "mon", "ago", "end_of_month", "months_since",
"default_inspect", "minus_without_duration", ...
>> "19270412000000".to_date.class
=> Date
>> "19270412000000".class
=> String
>>