[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Why this ruby code is not working

Raj Singh

2/4/2007 3:27:00 AM

Why the value of temp2 is not consistent with the value of temp.

Loading development environment.
>> list = []
=> []
>> (1..10).to_a.each do |i|
?> start_time_temp = i.days.ago.beginning_of_day
>> puts start_time_temp
>> temp2 = start_time_temp.strftime("%m-%B-%Y")
>> puts temp2
>> end
Fri Feb 02 00:00:00 -0500 2007
02-February-2007

Thu Feb 01 00:00:00 -0500 2007
02-February-2007

Wed Jan 31 00:00:00 -0500 2007
01-January-2007

Tue Jan 30 00:00:00 -0500 2007
01-January-2007

Mon Jan 29 00:00:00 -0500 2007
01-January-2007

Sun Jan 28 00:00:00 -0500 2007
01-January-2007
Sat Jan 27 00:00:00 -0500 2007
01-January-2007
Fri Jan 26 00:00:00 -0500 2007
01-January-2007
Thu Jan 25 00:00:00 -0500 2007
01-January-2007
Wed Jan 24 00:00:00 -0500 2007
01-January-2007
=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

--
Posted via http://www.ruby-....

1 Answer

Raj Singh

2/4/2007 3:47:00 AM

0

Never mind. I just need some coffee.

Sorry for the trouble.



--
Posted via http://www.ruby-....