# Function Ruy Code

**URL:** <https://www.ruby-forum.com/t/function-ruy-code/189691>\
**Category:** Rails\
**Created:** [June 5, 2010, 11:26am UTC](https://www.ruby-forum.com/t/function-ruy-code/189691 "2010-06-05T11:26:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Srinivas\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@Srinivas\_G](https://www.ruby-forum.com/u/Srinivas_G)\
**Post date:** [June 5, 2010, 11:26am UTC](https://www.ruby-forum.com/t/function-ruy-code/189691/1 "2010-06-05T11:26:57Z")

</div>

Explain the error in the following sample of Ruby code. Reference the  
line which the error is found on:

1- function effective\_date(eff\_date)  
2- if eff\_date.length \< 3  
3- eff\_date = Time.now + (eff\_date.to\_i \* 24 \* 60 \* 60)  
4- return eff\_date.strftime("%m%d%Y")  
5- else  
6- return eff\_date  
7- end  
8- end
