Project

General

Profile

Misc #19098

Updated by andrykonchin (Andrew Konchin) over 1 year ago

It seems `%z` behaves in some surprising way when it is combined with width - sign `+` is placed at the beginning of the result string: 

 ```ruby 
 Time.now.strftime("%10z") 
 => "+000000200" 

 Time.now.strftime("%_10z") 
 => "        +200" 
 ``` 

 It seems a time zone offset is treated as a number. It probably makes sense with default format but it looks strange with `:` separators: 

 ```ruby 
 Time.now.strftime("%10::z") 
 # => "+002:00:00" 
 ```

Back