From: John W Higgins Date: 2010-03-04T06:49:29+09:00 Subject: Re: Logger datetime_format not respected --000e0cd6d0a6cdacb30480ec7425 Content-Type: text/plain; charset=ISO-8859-1 Good Afternoon, On Wed, Mar 3, 2010 at 1:35 PM, Karl wrote: > When creating a new logger, the datetime_format is not respected. > > require 'logger' > log = Logger.new(STDOUT) > log.datetime_format = "%Y-%m-%d %H:%M:%S" > log.info "#{log.datetime_format}" > > outputs: > > I, [2010-03-03 14:31:31#66665] INFO -- : %Y-%m-%d %H:%M:%S > > Tried in ruby 1.9.1 and 1.8.7 with same results. What am I missing? > > Ok, I'll play along - what exactly where you expecting? You seem to have gotten exactly what you requested? Are you assuming that %H is hours on a 12 hour clock? If so you are looking for %I - %H is 24 hour clock ( http://ruby-doc.org/core/classes/Time.html#M000298) John --000e0cd6d0a6cdacb30480ec7425--