ActionsLike0
Misc #19098
openTime#strftime: %z and width
Status:
Open
Assignee:
-
Description
It seems %z
behaves in some surprising way when it is combined with a width - sign +
is placed at the beginning of the result string:
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:
Time.now.strftime("%10::z")
# => "+002:00:00"
So I would expect that %z
directive output to be treated as a non-numerical and padded by default with spaces.
Updated by andrykonchin (Andrew Konchin) over 2 years ago
- Tracker changed from Bug to Misc
- Description updated (diff)
- ruby -v deleted (
3.1.2p20) - Backport deleted (
2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN)
ActionsLike0