search for: defining_custom_date_time_formats

Displaying 2 results from an estimated 2 matches for "defining_custom_date_time_formats".

2006 Jan 04
3
date conversion
I have the date saved in a database in the following format ''20060102170020''. How do I go about converting the date in the format of January, 01, 1901? I searched all over and found something similiar using ''to_formatted_s''. However I only found support for converting month to a three letter format (e.g. ''Jan''). Is there an eaiser way?
2006 Jan 09
5
Formatting timestamp objects
I want to print my timestamp objects in a specific format. I want to print a date like this: Sunday, January 8 2006 I don''t want it to print January 08. For the time, I want it to look like this: 9:08 pm Not 09:08 and lower case PM. I created these methods: def format_date(date) date.strftime("%A, %B #{date.day} #{date.year}") end def format_time(date) if