# Help with date format

**URL:** <https://www.ruby-forum.com/t/help-with-date-format/125144>\
**Category:** Rails\
**Created:** [January 6, 2008, 6:29am UTC](https://www.ruby-forum.com/t/help-with-date-format/125144 "2008-01-06T06:29:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![veeraa2003](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/b487fb/32.png) [@veeraa2003](https://www.ruby-forum.com/u/veeraa2003)\
**Post date:** [January 6, 2008, 6:29am UTC](https://www.ruby-forum.com/t/help-with-date-format/125144/1 "2008-01-06T06:29:19Z")

</div>

HI Everybody,

I have one date instant. I want to format the date using strftime  
method, and the result I want is

2008 Jan 06th

Here How can I add the suffix with the day like (1st, 2nd, 3rd, 4th  
etc).

Thanks with regards,  
Veeraa.T

---

<div class="post-metadata">

**Author:** ![veeraa2003](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/b487fb/32.png) [@veeraa2003](https://www.ruby-forum.com/u/veeraa2003)\
**Post date:** [January 6, 2008, 7:57am UTC](https://www.ruby-forum.com/t/help-with-date-format/125144/2 "2008-01-06T07:57:37Z")

</div>

I don’t believe you’re going to get that directly using strftime.  
You’ll need to write your own helper method to return the day part  
with 1st, 2nd, etc. You could use strftime inside that helper to give  
you 2008 Jan 06 then concatenate the st, nd or th to the end of the  
string. That shouldn’t be too difficult to write.

On Jan 6, 12:29 am, Veera S. \<rails-mailing-l…@andreas-

---

<div class="post-metadata">

**Author:** ![veeraa2003](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/b487fb/32.png) [@veeraa2003](https://www.ruby-forum.com/u/veeraa2003)\
**Post date:** [January 6, 2008, 8:09pm UTC](https://www.ruby-forum.com/t/help-with-date-format/125144/3 "2008-01-06T20:09:40Z")

</div>

[http://svn.webtest.wvu.edu/repos/rails/plugins/eztime/](http://svn.webtest.wvu.edu/repos/rails/plugins/eztime/) might help.
