<font face="Verdana,Arial,Helvetica,sans-serif" size="2"><div>Hi there, </div><div><br></div><div>I am curious about how an autoupdating type property like `NSTimeZone.local` could be implemented, given that it is a <b>value</b> (the type is TimeZone). The requirement essentially is that if the default timezone is changed, the change should reflect in all copies of this value.</div><div><br></div><div><p style="font-size: 14px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;"><font color="#bb2ca2">import</font></span><span style="font-variant-ligatures: no-common-ligatures"> Foundation</span></p><p style="font-size: 14px; line-height: normal; font-family: Menlo; min-height: 16px;"><span style="font-variant-ligatures: no-common-ligatures"></span><br></p><p style="font-size: 14px; line-height: normal; font-family: Menlo;"><font color="#703daa"><span style="font-variant-ligatures: no-common-ligatures;"><font color="#bb2ca2">let</font></span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#000000"> local = </font></span><span style="font-variant-ligatures: no-common-ligatures">NSTimeZone</span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#000000">.</font></span><span style="font-variant-ligatures: no-common-ligatures">local</span></font></p><p style="font-size: 14px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;"><font color="#bb2ca2">let</font></span><span style="font-variant-ligatures: no-common-ligatures"> local1 = </span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#4f8187">local</font></span></p><p style="font-size: 14px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;"><font color="#4f8187"><span style="font-variant-ligatures: no-common-ligatures;"><font color="#3d1d81">print</font></span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#000000">(</font></span><span style="font-variant-ligatures: no-common-ligatures;">local</span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#000000">) //prints the default TimeZone</font></span><br></font></span></p><p style="font-size: 14px; line-height: normal; font-family: Menlo;"><font color="#4f8187"><span style="font-variant-ligatures: no-common-ligatures;"><font color="#3d1d81">print</font></span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#000000">(</font></span><span style="font-variant-ligatures: no-common-ligatures">local1</span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#000000">) //prints the default TimeZone</font></span></font></p><p style="font-size: 14px; line-height: normal; font-family: Menlo;"><font color="#4f8187"><br></font></p><p style="font-size: 14px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;"><font color="#bb2ca2">let</font></span><span style="font-variant-ligatures: no-common-ligatures"> t = </span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#703daa">TimeZone</font></span><span style="font-variant-ligatures: no-common-ligatures">(identifier: </span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#d12f1b">"America/Chicago"</font></span><span style="font-variant-ligatures: no-common-ligatures">)!</span></p><p style="font-size: 14px; line-height: normal; font-family: Menlo;"><font color="#703daa"><span style="font-variant-ligatures: no-common-ligatures">NSTimeZone</span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#000000">.</font></span><span style="font-variant-ligatures: no-common-ligatures">default</span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#000000"> = </font></span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#4f8187">t</font></span></font></p><p style="font-size: 14px; line-height: normal; font-family: Menlo; min-height: 16px;"><span style="font-variant-ligatures: no-common-ligatures"></span><br></p><p style="font-size: 14px; line-height: normal; font-family: Menlo;"><font color="#3d1d81"><span style="font-variant-ligatures: no-common-ligatures">print</span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#000000">(</font></span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#4f8187">local</font></span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#000000">) //prints "America/Chicago (autoupdatingCurrent)</font></span></font></p><p style="font-size: 14px; line-height: normal; font-family: Menlo;"><font color="#4f8187"><span style="font-variant-ligatures: no-common-ligatures;"><font color="#3d1d81">print</font></span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#000000">(</font></span><span style="font-variant-ligatures: no-common-ligatures">local1) </span>//prints "America/Chicago (autoupdatingCurrent)</font></p></div><div><font face="Verdana,Arial,Helvetica,sans-serif" size="2"><font><font><div class="socmaildefaultfont" dir="ltr"><div class="socmaildefaultfont" dir="ltr"><div class="socmaildefaultfont" dir="ltr"><div dir="ltr" style="font-style: normal;"><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif"><br></font></div><div dir="ltr" style="font-style: normal;"><br></div><div dir="ltr" style="font-style: normal;">What makes it complicated is that TimeZone is a value type. I hope I am not missing something fundamental here!</div><div dir="ltr" style="font-style: normal;"><br></div><div dir="ltr" style="font-style: normal;">Any ideas or information will be highly appreciated. Thanks!</div><div dir="ltr" style="font-style: normal;"><br></div><div dir="ltr" style="font-style: normal;"><span style="font-family: 'Sans Serif', Verdana, Arial, Helvetica, sans-serif;">Pushkar N Kulkarni,</span><br></div>
<div dir="ltr" style="font-style: normal;"><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif">IBM Runtimes</font></div><div dir="ltr" style="font-style: normal;"><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif"><br></font></div><div dir="ltr"><font face="serif, Times New Roman, Times, serif"><i>Simplicity is prerequisite for reliability - Edsger W. Dijkstra</i></font></div>
<div dir="ltr" style="font-style: normal; font-size: 10.5pt; font-family: Arial;"><br></div></div></div></div></font></font></font></div></font><BR>