Skip to content

patch about timezone name of China Standard Time on windows

7 messages · Ivan Krylov, gong yu, Simon Urbanek

#
Last week ,I report a issuse about  timezone name about" China Standard Time", R on windows will report to Asia/Taipei , but it should be Asia/Shanghai,
Since  still now  no feedback (maybe because for my poor english). So resubmit a patch about this .

Change it from Asia/Taipei to Asia/Shanghai could veryfied from
1  tzutil (this is windows buildin command  made by microsoft )  , run tzutil /l , it show  " China Standard Time" is (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi  (AKA Asia/Shanghai on linux)? and furthermore , tzutil /l also report   Taipei Standard Time (Asia/Taipei) , so Sys.timezone() report  " China Standard Time" to Asia/Taipei indeed uncorrect.

2  timezone and their definition on window could found on microsoft website
   https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-10

   in this document , it also show " China Standard Time" is (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi  (AKA Asia/Shanghai on linux) ,

3  also in unicode org web , the lastest document about time also support this patch
https://unicode-org.github.io/cldr-staging/charts/42/supplemental/zone_tzid.html

  China Standard Time   Asia/Shanghai

and in current R implemention , it report " China Standard Time" is incorrect ,but "Taipei Standard Time" is correct, so this patch only need modify " China Standard Time" and will not affect other timezone.

please feel free to share your thoughts or feedbacks of this patch

Index: src/extra/tzone/registryTZ.c
===================================================================
--- src/extra/tzone/registryTZ.c????(revision 83566)
+++ src/extra/tzone/registryTZ.c????(working copy)
@@ -51,7 +51,7 @@
     { L"Central Pacific Standard Time", "Pacific/Guadalcanal" },
     { L"Central Standard Time", "America/Chicago" },
     { L"Central Standard Time (Mexico)", "America/Mexico_City" },
-    { L"China Standard Time", "Asia/Taipei" },
+    { L"China Standard Time", "Asia/Shanghai" },
     { L"Dateline Standard Time", "Pacific/Kwajalein" },
     { L"E. Africa Standard Time", "Africa/Nairobi" },
     { L"E. Australia Standard Time", "Australia/Brisbane" },





Yu Gong
#
Hello Yu Gong!

I'm not an R developer, but I hope I'll be able to help you with my
advice.

On Fri, 6 Jan 2023 04:24:43 +0000
gong yu <yugong at outlook.com> wrote:

            
Sometimes, everyone is too busy to discuss a patch right now, but a
patch just left on R-devel may be eventually forgotten before there's
time for discussion. Try asking for a Bugzilla account (by following
the guide at <https://www.r-project.org/bugs.html>) and submitting the
patch there.
Thank you for verifying this. As far as I can tell, the file has always
contained both entries referring to "Asia/Taipei":
https://github.com/r-devel/r-svn/blame/22bf3a2cb1dd6844e69c9214d990bf438a485db7/src/extra/tzone/registryTZ.c
#
Thanks Ivan!
I  really missed the information on   https://www.r-project.org/bugs.html .  Instead ,  browse https://bugs.r-project.org<https://bugs.r-project.org/> and didn't found where to registration and login, then send email to this list.
will send a email to bug-report-request at r-project.org.
for two  entries in  registryTZ.c<https://github.com/r-devel/r-svn/blame/22bf3a2cb1dd6844e69c9214d990bf438a485db7/src/extra/tzone/registryTZ.c>  , the China Standard Time is incorrect ,but Taipei Standard Tim is ok

Best regards,
Yu Gong



________________________________
??????: Ivan Krylov <krylov.r00t at gmail.com>
???????: 2023??1??6?? 15:26
?????: gong yu <yugong at outlook.com>
????: r-devel at r-project.org <r-devel at r-project.org>
????: Re: [Rd] patch about timezone name of China Standard Time on windows

Hello Yu Gong!

I'm not an R developer, but I hope I'll be able to help you with my
advice.

On Fri, 6 Jan 2023 04:24:43 +0000
gong yu <yugong at outlook.com> wrote:

            
Sometimes, everyone is too busy to discuss a patch right now, but a
patch just left on R-devel may be eventually forgotten before there's
time for discussion. Try asking for a Bugzilla account (by following
the guide at <https://www.r-project.org/bugs.html>) and submitting the
patch there.
Thank you for verifying this. As far as I can tell, the file has always
contained both entries referring to "Asia/Taipei":
https://github.com/r-devel/r-svn/blame/22bf3a2cb1dd6844e69c9214d990bf438a485db7/src/extra/tzone/registryTZ.c

--
Best regards,
Ivan
#
Just a quick comment here - this is not as easy as it sounds, because the code is in the "extra" directory which means it is based on upstream sources, so those sources are typically not patched manually as it would be hard to apply upstream updates. In this case the standards have changed since the last update, so the way to go about this would be to upgrade according to latest sources and standards as it's quite possible that the issue has been addressed there. However, such update is quite time-consuming process as we have to make sure that the standards are matched and changes have not broken something in R. So you can file an issue so this is on record, but I wouldn't include patches since they cannot be applied directly for reasons explained as it has to be done as a part of the full update, not just a single entry.

Cheers,
Simon
#
understand your concerns.
for registerTZ.c itself , IMHO , the most important part is the definition of tztable[] .  which come form http://unicode.org/cldr/data/diff/supplemental/windows_tzid.html ,but it can??t access now, the lasted version is https://unicode-org.github.io/cldr-staging/charts/42/supplemental/zone_tzid.html.

maybe  we need write a script  or small tools  , use it sync with unicode standard and microsoft registery or tzutil , to generate tztable definition?
will this better than current way? if it is i
will try it in next 1-2 weeks.

best regards
Yu Gong
________________________________
??????: Simon Urbanek <simon.urbanek at R-project.org>
???????: 2023??1??7?? 6:36
?????: gong yu <yugong at outlook.com>
????: Ivan Krylov <krylov.r00t at gmail.com>; r-devel at r-project.org <r-devel at r-project.org>
????: Re: [Rd] patch about timezone name of China Standard Time on windows

Just a quick comment here - this is not as easy as it sounds, because the code is in the "extra" directory which means it is based on upstream sources, so those sources are typically not patched manually as it would be hard to apply upstream updates. In this case the standards have changed since the last update, so the way to go about this would be to upgrade according to latest sources and standards as it's quite possible that the issue has been addressed there. However, such update is quite time-consuming process as we have to make sure that the standards are matched and changes have not broken something in R. So you can file an issue so this is on record, but I wouldn't include patches since they cannot be applied directly for reasons explained as it has to be done as a part of the full update, not just a single entry.

Cheers,
Simon

  
  
1 day later
#
I'm not sure how simple it would be to script this since others have been working on this, but if it was doable it would be a good start. There are others that know more about CLDR than I do.

Cheers,
Simon
#
Search and read some information about windows timezone to Linux timezone mapping this week.
 And found an .net library implement this, https://github.com/mattjohnsonpint/TimeZoneConverter . Question is how to use it?
________________________________
??????: Simon Urbanek <simon.urbanek at R-project.org>
???????: 2023??1??9?? 5:56
?????: gong yu <yugong at outlook.com>
????: r-devel at r-project.org <r-devel at r-project.org>
????: Re: [Rd] patch about timezone name of China Standard Time on windows
I'm not sure how simple it would be to script this since others have been working on this, but if it was doable it would be a good start. There are others that know more about CLDR than I do.

Cheers,
Simon