John Athayde
2005-Jul-27 14:48 UTC
using distance_of_time_in_words with a variable in time.local()
Another must be simple and just not seeing it question: I have a helper class that does this: def countdown duedate = @project.due_at distance_of_time_in_words(Time.now, Time.local("#{duedate}")) end the value of duedate is 2005-08-26, however it returns that it is 2034 days away. I tried reformatting the time to fit the example in the PragProg book ( Time.local(2005, 12, 25) ) by using strftime("%Y, %m, %d") but it returns an error as well. It does echo out in an embedded ruby string to the screen in the exact same format as I want it to. so I''m assuming there must be some parsing order issues... It seems to have problems parsing the variable. Any ideas would be most appreciated. Thanks in advance. -- John Athayde bobo-8WfjrGkLNeNByuSxxbvQtw@public.gmane.org Meticulous | www.meticulous.com (work) Rotoscope | www.rotoscope.com (sound: rock band) Boboroshi & Kynz | www.boboroshiandkynz.com (sound: electronic) Personal Weblog | www.boboroshi.com (play) "Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety." - Benjamin Franklin (1706-1790) Reply of the Pennsylvania Assembly to the Governor November 11, 1755 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails