[tz] 回复: 回复: zoneinfo generating issues

Ian Abbott abbotti at mev.co.uk
Fri Mar 5 20:29:59 UTC 2021


On 05/03/2021 10:01, 汪蒙蒙(木之) via tz wrote:
> Sorry, I made a mistake and the actual diff result is,
> zone 	local time 	by 2020d  utc time 	by 2021a utc time 	
> America/Adak 	2022-11-01 00:00:00 	2022-11-01 09:00:00 	2022-11-01 
> 10:00:00 	
> America/Anchorage 	2022-11-01 00:00:00 	2022-11-01 08:00:00 	2022-11-01 
> 09:00:00 	
> America/Asuncion 	2022-10-01 00:00:00 	2022-10-01 04:00:00 	2022-10-01 
> 03:00:00 	
> America/Atka 	2022-11-01 00:00:00 	2022-11-01 09:00:00 	2022-11-01 10:00:00
> 
> 
> but the problem still exists. I have put my analysis tool and its codein 
> the docker image, "damon0708/zic:v0.3". The tool is writen in golang and 
> easy to be used.
> # ./main -h
>    -l string
>      local time need to transfer (default "2022-11-01 00:00:00")
>    -path string
>      used to parse timezone (default "/usr/share/zoneinfo")
>    -tz string
>      the timezone you want transfer (default "America/Adak")
> 
> After making the zoneinfo in path "/app/zoneinfo",
> 
> # ./main -l "2022-11-01 00:00:00" -path "/usr/share/zoneinfo" -tz 
> "America/Adak"
> UTC: 2022-11-01 09:00:00 +0000 UTC
> # ./main -l "2022-11-01 00:00:00" -path "/app/zoneinfo" -tz "America/Adak"
> UTC: 2022-11-01 10:00:00 +0000 UTC
> 
> The tool uses the golang standard library "time", which can be 
>   specified the zoneinfo path by the env "ZONEINFO". So I don't think it 
> is the problem of the tool.

The problem seems to be related to the use of leapseconds.

# ./main -l "2022-11-01 00:00:00" -path /usr/share/zoneinfo -tz America/Adak
UTC: 2022-11-01 09:00:00 +0000 UTC
# ./main -l "2022-11-01 00:00:00" -path /usr/share/zoneinfo/right -tz 
America/Adak
UTC: 2022-11-01 10:00:00 +0000 UTC

I've attached the source of main.go that Paul wanted.

-- 
-=( Ian Abbott <abbotti at mev.co.uk> || MEV Ltd. is a company  )=-
-=( registered in England & Wales.  Regd. number: 02862268.  )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.go
Type: text/x-go
Size: 997 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20210305/f725f71d/attachment.bin>


More information about the tz mailing list