<div dir="ltr">The 12-hour clock will always remain a mystery to me <a href="https://en.wikipedia.org/wiki/12-hour_clock">https://en.wikipedia.org/wiki/12-hour_clock</a><br><br>“Likewise, some U.S. style guides recommend either clarifying &quot;midnight&quot; with other context clues, such as specifying the two dates between which it falls, or not referring to midnight at all. For an example of the latter method, &quot;midnight&quot; is replaced with &quot;11:59 p.m.&quot; for the end of a day or &quot;12:01 a.m.&quot; for the start of a day. That has become common in the United States in legal contracts and for airplane, bus, or trainschedules, though some schedules use other conventions. Occasionally, when trains run at regular intervals, the pattern may be broken at midnight by displacing the midnight departure one or more minutes, such as to 23:59 or 00:01.”<br><br>Michael<div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 29, 2016 at 6:15 AM, Zhao Xin via swift-users <span dir="ltr">&lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:georgia,serif">It should be called 00:01:00 A.M., instead of 12:01:00 A.M. Shouldn&#39;t it?</div><div style="font-family:georgia,serif"><br></div><div><p style="font-family:Menlo;margin:0px;font-size:11px;line-height:normal"><span style="color:rgb(187,44,162)">import</span><span> Foundation</span></p><p style="font-family:Menlo;margin:0px;font-size:11px;line-height:normal;min-height:13px"><span></span><br></p><p style="font-family:Menlo;margin:0px;font-size:11px;line-height:normal"><span style="color:rgb(187,44,162)">let</span><span> now = </span><span style="color:rgb(112,61,170)">Date</span><span>()</span></p><p style="font-family:Menlo;margin:0px;font-size:11px;line-height:normal"><span style="color:rgb(187,44,162)">var</span><span> dc = </span><span style="color:rgb(112,61,170)">Calendar</span><span>.</span><span style="color:rgb(112,61,170)">current</span><span>.</span><span style="color:rgb(61,29,129)">dateComponent<wbr>s</span><span>([.</span><span style="color:rgb(61,29,129)">year</span><span>, .</span><span style="color:rgb(61,29,129)">month</span><span>, .</span><span style="color:rgb(61,29,129)">day</span><span>], from: </span><span style="color:rgb(79,129,135)">now</span><span>)</span></p><p style="font-family:Menlo;margin:0px;font-size:11px;line-height:normal;color:rgb(112,61,170)"><span style="color:rgb(79,129,135)">dc</span><span style="color:rgb(0,0,0)">.</span><span>minute</span><span style="color:rgb(0,0,0)"> = </span><span style="color:rgb(39,42,216)">1</span></p><p style="font-family:Menlo;margin:0px;font-size:11px;line-height:normal"><span style="color:rgb(187,44,162)">let</span><span> date = </span><span style="color:rgb(112,61,170)">Calendar</span><span>.</span><span style="color:rgb(112,61,170)">current</span><span>.</span><span style="color:rgb(61,29,129)">date</span><span>(from: </span><span style="color:rgb(79,129,135)">dc</span><span>)</span></p><p style="font-family:Menlo;margin:0px;font-size:11px;line-height:normal"><span style="color:rgb(61,29,129)">print</span><span>(</span><span style="color:rgb(112,61,170)">DateFormatter</span><span>.</span><span style="color:rgb(61,29,129)">localizedS<wbr>tring</span><span>(from: </span><span style="color:rgb(79,129,135)">date</span><span>!, dateStyle: .</span><span style="color:rgb(61,29,129)">long</span><span>, timeStyle: .</span><span style="color:rgb(61,29,129)">long</span><span>))</span></p><p style="font-family:Menlo;margin:0px;font-size:11px;line-height:normal">






</p><p style="font-family:Menlo;margin:0px;font-size:11px;line-height:normal;color:rgb(0,132,0)"><span>// prints &quot;August 29, 2016 at 12:01:00 AM GMT+8&quot;</span></p><div style="font-family:georgia,serif"><span><br></span></div><div style="font-family:georgia,serif"><span><br></span></div><div><font face="georgia, serif" color="#000000">Zhaoxin</font></div></div></div>
<br>______________________________<wbr>_________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br>
<br></blockquote></div><br></div></div>