https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-05-25T11:39:19ZRuby Issue Tracking SystemRuby master - Bug #6491: DateTime.strftime('%Z') output is incorrect formathttps://bugs.ruby-lang.org/issues/6491?journal_id=268182012-05-25T11:39:19Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>tadf (tadayoshi funaba)</i></li></ul> Ruby master - Bug #6491: DateTime.strftime('%Z') output is incorrect formathttps://bugs.ruby-lang.org/issues/6491?journal_id=268312012-05-26T12:05:53Ztadf (tadayoshi funaba)
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Rejected</i></li><li><strong>Priority</strong> changed from <i>Normal</i> to <i>3</i></li></ul><p>i don't know how to determine such a name.<br>
moreover, GMT is already dead.</p>
<p>this is not a bug, not an incorrect format.</p> Ruby master - Bug #6491: DateTime.strftime('%Z') output is incorrect formathttps://bugs.ruby-lang.org/issues/6491?journal_id=268322012-05-26T12:11:36Zzombor (Jeremy Bush)contractfrombelow@gmail.com
<ul></ul><p>Time.parse().strftime('%Z') outputs <code>UTC</code>. Notice I said "similar format". It should output a human consumable output like Time.strftime('%Z') does. If nothing else, the two identically named functions output two different things.</p> Ruby master - Bug #6491: DateTime.strftime('%Z') output is incorrect formathttps://bugs.ruby-lang.org/issues/6491?journal_id=268332012-05-26T12:15:00Zzombor (Jeremy Bush)contractfrombelow@gmail.com
<ul></ul><p>And if it's not a bug, what's the difference between <code>%:z</code> and <code>%Z</code>? Currently they basically output the same thing. The documentation says: <code>%Z - Time zone abbreviation name</code>.</p> Ruby master - Bug #6491: DateTime.strftime('%Z') output is incorrect formathttps://bugs.ruby-lang.org/issues/6491?journal_id=268342012-05-26T12:39:18Ztadf (tadayoshi funaba)
<ul></ul><p>i tried to avoid the term of UTC or similar words here carefully.<br>
because, we use +00:00 as a local time.</p>
<p>ruby's Time object has a mode UTC/local time.<br>
but, DateTime does not so.<br>
DateTime does not have the obvious local time zone.</p>
<p>incorrect?<br>
i don't think so.<br>
iso8601 is a human readable format.</p> Ruby master - Bug #6491: DateTime.strftime('%Z') output is incorrect formathttps://bugs.ruby-lang.org/issues/6491?journal_id=268352012-05-26T13:09:52Zzombor (Jeremy Bush)contractfrombelow@gmail.com
<ul></ul><p>If this is expected functionality, then perhaps the documentation should be changed. It clearly says <code>%Z - Time zone abbreviation name</code>. This in my eyes (and about 10 other ruby developers I asked before i filed this) means UTC, CST, etc.</p>
<p>It may be a human readable format, but it sure isn't the "Time zone abbreviation name" as the documentation says.</p> Ruby master - Bug #6491: DateTime.strftime('%Z') output is incorrect formathttps://bugs.ruby-lang.org/issues/6491?journal_id=268362012-05-26T18:05:09Ztadf (tadayoshi funaba)
<ul></ul><p>Time's one also says.<br>
but, actually it depends on platform.<br>
on windows, may not always return abbreviation.</p>
<p>this may be a matter of common sense.<br>
but, it's not so good for novice.</p> Ruby master - Bug #6491: DateTime.strftime('%Z') output is incorrect formathttps://bugs.ruby-lang.org/issues/6491?journal_id=405152013-07-16T02:24:40Zkenips (Ken Ip)ken.ip@pushpulllabs.com
<ul></ul><p><a class="user active user-mention" href="https://bugs.ruby-lang.org/users/183">@tadf (tadayoshi funaba)</a> why is this closed? To me a discrepancy between DateTime.strftime and Time.strftime should either be documented or fixed. You're saying that:</p>
<blockquote>
<p>DateTime.now.strftime('%z %Z')<br>
=> "-0400 -04:00"</p>
</blockquote>
<blockquote>
<p>Time.now.strftime('%z %Z')<br>
=> "-0400 EDT"</p>
</blockquote>
<p>is OK?</p>