DateTime.strftime('%Z') output is incorrect format
DateTime.parse('2012/05/23').strftime('%Z') should output 'GMT' (or a similar string). It outputs "+00:00" (or a similar offset string).
#5 [ruby-core:45250] Updated by tadf (tadayoshi funaba) about 5 years ago
i tried to avoid the term of UTC or similar words here carefully.
because, we use +00:00 as a local time.
ruby's Time object has a mode UTC/local time.
but, DateTime does not so.
DateTime does not have the obvious local time zone.
i don't think so.
iso8601 is a human readable format.
#6 [ruby-core:45251] Updated by zombor (Jeremy Bush) about 5 years ago
If this is expected functionality, then perhaps the documentation should be changed. It clearly says
%Z - Time zone abbreviation name. This in my eyes (and about 10 other ruby developers I asked before i filed this) means UTC, CST, etc.
It may be a human readable format, but it sure isn't the "Time zone abbreviation name" as the documentation says.
#8 [ruby-core:56025] Updated by kenips (Ken Ip) almost 4 years ago
@tadf why is this closed? To me a discrepancy between DateTime.strftime and Time.strftime should either be documented or fixed. You're saying that:
=> "-0400 -04:00"
=> "-0400 EDT"