2020年5月8日金曜日

VS code server failed to start

VS Code ssh remote is not stable,
I have connected to Debian on VirtualBox and after closed the window and shutdone the Debian.
Then Booting up Debian and I Tried to connect from VSCode, I could not successfully establish connection. SSH from terminal is working fine so it is the issue in VSCode.  

solution
running the  folowing command from VS Code from host.  (to open comand plate "ctr + shift + p" .)
Uninstall VS Code Server
and trying to connect from VSCode. I can connect and see folders/Directories on the Debian

2020年5月6日水曜日

VS Code remote SSH to Debian on VirtualBox

Short note how to setup SSH Remote connect VS Code from Windows 10 to Debian vm as user1 on VirtualBox.
Assuming Debian is already running on VM and the user name is "user1" and the ip address is 192.168.122.1.  SSH port was portforward to 3022. 

1.  install OpenSSH for windows server
open power shell terminal on Windows and run following commands
 
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'

# This should return the following output:

Name  : OpenSSH.Client~~~~0.0.1.0
State : NotPresent
Name  : OpenSSH.Server~~~~0.0.1.0
State : NotPresent

# Install the OpenSSH Client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

# Install the OpenSSH Server
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

# Both of these should return the following output:

Path          :
Online        : True
RestartNeeded : False
 
  

2.  SSH KeyGen
create ssh key pair in windows local to set up ssh public key authenticate

$ssh-keygen -t rsa -b 4096

$cd .ssh

#make sure ~/.ssh directry is existing in the user home of Debian. 

$ cat id_rsa.pub | ssh -p 3022 user1@192.168.122.1  'cat >>.ssh/authorized_keys'

3.  Install VSCode SSH remote extension
The Remote - SSH extension

4.  Install VSCode SSH remote extension 

5.  Edit/Create the SSH config file
Edit .ssh/config file on your Windows. .ssh folder is located on C:User/username/.ssh   

Host 192.168.122.1
    HostName 192.168.122.1
    User user1
    Port 3022
now everything is done.
click the ssh connection button on the left bottom of VSCode and follow the prompt.

2020年4月23日木曜日

to clean MacOS Xcode CoreSimulator device folder


When macos strage usage was getting bigger and you are using Xcode, to clean the simulator folder  is going to help free up your strage space.
more info

$xcrun simctl delete unavailable

2020年4月22日水曜日

SwiftUI data visualization, ploting library

One of useful  plot library for SwiftUI

https://github.com/KanshuYokoo/SwiftUIGraphPlotLibrary
It is very nice library to plot data on SwiftUI project ad seem to work on both iOS and MacOSX



2020年4月14日火曜日

swift, useful example of keypath


extension Sequence {
    func sorted<T: Comparable>(by keyPath:KeyPath<Element, T>) -> [Element]{
        return sorted {a, b in
            return a[keyPath: keyPath] < b[keyPath:keyPath]
        }
    }
    
    func map <T> (_ keyPath: KeyPath<Element, T>) -> [T] {
        return map {$0[keyPath: keyPath]}
    }
    
    func min <T: Comparable> (_ keyPath: KeyPath<Element, T>) -> T? {
        return map(keyPath).min()
    }
    
    func max<T: Comparable> (_ keyPath: KeyPath<Element, T>) -> T? {
        return map(keyPath).max()
    }
    
}

2020年4月2日木曜日

WSL2 - npm install : pm ERR! code: 'EACCES',

Tring to install npm package by

$ npm install

There were many errors with the code
npm ERR!      code: 'EACCES'

the solution is

$npm config set unsafe-perm=true

Tring the npm install again and it succeeded.


2020年3月27日金曜日

ios app, internationalization ,i18n

How to prepare i18n for my ios app.

1. add languages to translate
go to project setting and tap info
find Localizations, press + and add any languages 


2. add string file 
This is the list of strings that should be translated in 

File menu and choose New > File, then select Strings File from the list of file types 

2020年2月24日月曜日

(Mix) Unpacking tarball failed:

I got the elixir phoenix error on WSL2 as bellow.
** (Mix) Unpacking tarball failed: inner tarball error, not owner

It was not inthe linux directory but on the Windows file system accessing through the /mnt/c/ . I was guessing it was the reason.

$ mix deps.get
Resolving Hex dependencies...
Dependency resolution completed:
New:
...
...
* Updating phoenix (Hex package)
** (Mix) Unpacking tarball failed: inner tarball error, not owner

solution. Mount C: with the drvfs type.

$sudo umount /mnt/c
$sudo mount -t drvfs C: /mnt/c -o metadata

see the official blog post from microsoft


DrvFs is a filesystem plugin to WSL that was designed to support interop between WSL and the Windows filesystem. DrvFs enables WSL to mount drives with supported file systems under /mnt, such as /mnt/c, /mnt/d, etc. 

So inside mix deps.get, sometime write permissions were  required and it caused the error before.
Note that this mount with drvfs should be performed each time starting WSL.

and I feel it is really slow to process compiling ...

2020年2月23日日曜日

xcrum simctl push, send apn payload to ios simulator

Xcrun is the command line tool of Xcode and it's simctl push can test push notification on ios Simulator with xcode 11.4 ( it is still beta as of 23.02.2020)

$xcrun simctl push --help

to get device information and it's identifier run the below command. in general it is easier to using "booted" as targeting device though. however if more than two simulators are running device identifier should be clearly specified.

$xcrun simctl list devices | grep Booted

$xcrun simctl push booted com.example.app payload.json



2020年2月15日土曜日

How to get time in a particular time zone with Swift Data class.
set time zone to the DateFormatter() with identifiersecondsFromGMT, and abbreviation

let format = DateFormatter()
format.dateFormat = "yyyy-MM-dd HH:mm"

format.timeZone   = TimeZone(identifier: "Asia/Tokyo")
let timeTokyo =  format.string(from: date)
print("Tokyo                   : \(timeTokyo)")
format.timeZone = TimeZone(identifier: "Europe/Vatican")
let timeVatican = format.string(from: date)
print("Vatican                 : \(timeVatican)")

format.timeZone = TimeZone(secondsFromGMT: 32400)
print("Tokyo FromGMT           : \(format.string(from: date))")
format.timeZone = TimeZone(secondsFromGMT: 3600)
print("Vatican FromGMT         : \(format.string(from: date))")

format.timeZone = TimeZone(abbreviation: "GMT+9")
print("Tokyo fromAbbreviation  : \(format.string(from: date))")
format.timeZone = TimeZone(abbreviation: "GMT+1")
print("Vatican FromAbbreviation: \(format.string(from: date))")

Tokyo                   : 2020-02-16 01:18
Vatican                 : 2020-02-15 17:18
Tokyo FromGMT           : 2020-02-16 01:18
Vatican FromGMT         : 2020-02-15 17:18
Tokyo fromAbbreviation  : 2020-02-16 01:18
Vatican FromAbbreviation: 2020-02-15 17:18

Swift Timezone list
TimeZone: Africa/Abidjan Abbreviation: GMT secondsFromGMT: 0

TimeZone: Africa/Accra Abbreviation: GMT secondsFromGMT: 0

TimeZone: Africa/Addis_Ababa Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Africa/Algiers Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Asmara Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Africa/Bamako Abbreviation: GMT secondsFromGMT: 0

TimeZone: Africa/Bangui Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Banjul Abbreviation: GMT secondsFromGMT: 0

TimeZone: Africa/Bissau Abbreviation: GMT secondsFromGMT: 0

TimeZone: Africa/Blantyre Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Brazzaville Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Bujumbura Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Cairo Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Casablanca Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Ceuta Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Conakry Abbreviation: GMT secondsFromGMT: 0

TimeZone: Africa/Dakar Abbreviation: GMT secondsFromGMT: 0

TimeZone: Africa/Dar_es_Salaam Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Africa/Djibouti Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Africa/Douala Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/El_Aaiun Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Freetown Abbreviation: GMT secondsFromGMT: 0

TimeZone: Africa/Gaborone Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Harare Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Johannesburg Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Juba Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Africa/Kampala Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Africa/Khartoum Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Kigali Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Kinshasa Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Lagos Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Libreville Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Lome Abbreviation: GMT secondsFromGMT: 0

TimeZone: Africa/Luanda Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Lubumbashi Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Lusaka Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Malabo Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Maputo Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Maseru Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Mbabane Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Mogadishu Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Africa/Monrovia Abbreviation: GMT secondsFromGMT: 0

TimeZone: Africa/Nairobi Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Africa/Ndjamena Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Niamey Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Nouakchott Abbreviation: GMT secondsFromGMT: 0

TimeZone: Africa/Ouagadougou Abbreviation: GMT secondsFromGMT: 0

TimeZone: Africa/Porto-Novo Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Sao_Tome Abbreviation: GMT secondsFromGMT: 0

TimeZone: Africa/Tripoli Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Africa/Tunis Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Africa/Windhoek Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: America/Adak Abbreviation: HAST secondsFromGMT: -36000

TimeZone: America/Anchorage Abbreviation: AKST secondsFromGMT: -32400

TimeZone: America/Anguilla Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Antigua Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Araguaina Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Argentina/Buenos_Aires Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Argentina/Catamarca Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Argentina/Cordoba Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Argentina/Jujuy Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Argentina/La_Rioja Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Argentina/Mendoza Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Argentina/Rio_Gallegos Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Argentina/Salta Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Argentina/San_Juan Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Argentina/San_Luis Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Argentina/Tucuman Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Argentina/Ushuaia Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Aruba Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Asuncion Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Atikokan Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Bahia Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Bahia_Banderas Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Barbados Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Belem Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Belize Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Blanc-Sablon Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Boa_Vista Abbreviation: GMT-4 secondsFromGMT: -14400

TimeZone: America/Bogota Abbreviation: GMT-5 secondsFromGMT: -18000

TimeZone: America/Boise Abbreviation: MST secondsFromGMT: -25200

TimeZone: America/Cambridge_Bay Abbreviation: MST secondsFromGMT: -25200

TimeZone: America/Campo_Grande Abbreviation: GMT-4 secondsFromGMT: -14400

TimeZone: America/Cancun Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Caracas Abbreviation: GMT-4 secondsFromGMT: -14400

TimeZone: America/Cayenne Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Cayman Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Chicago Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Chihuahua Abbreviation: GMT-7 secondsFromGMT: -25200

TimeZone: America/Costa_Rica Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Creston Abbreviation: MST secondsFromGMT: -25200

TimeZone: America/Cuiaba Abbreviation: GMT-4 secondsFromGMT: -14400

TimeZone: America/Curacao Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Danmarkshavn Abbreviation: GMT secondsFromGMT: 0

TimeZone: America/Dawson Abbreviation: PST secondsFromGMT: -28800

TimeZone: America/Dawson_Creek Abbreviation: MST secondsFromGMT: -25200

TimeZone: America/Denver Abbreviation: MST secondsFromGMT: -25200

TimeZone: America/Detroit Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Dominica Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Edmonton Abbreviation: MST secondsFromGMT: -25200

TimeZone: America/Eirunepe Abbreviation: GMT-5 secondsFromGMT: -18000

TimeZone: America/El_Salvador Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Fort_Nelson Abbreviation: MST secondsFromGMT: -25200

TimeZone: America/Fortaleza Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Glace_Bay Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Godthab Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Goose_Bay Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Grand_Turk Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Grenada Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Guadeloupe Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Guatemala Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Guayaquil Abbreviation: GMT-5 secondsFromGMT: -18000

TimeZone: America/Guyana Abbreviation: GMT-4 secondsFromGMT: -14400

TimeZone: America/Halifax Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Havana Abbreviation: GMT-5 secondsFromGMT: -18000

TimeZone: America/Hermosillo Abbreviation: GMT-7 secondsFromGMT: -25200

TimeZone: America/Indiana/Indianapolis Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Indiana/Knox Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Indiana/Marengo Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Indiana/Petersburg Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Indiana/Tell_City Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Indiana/Vevay Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Indiana/Vincennes Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Indiana/Winamac Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Inuvik Abbreviation: MST secondsFromGMT: -25200

TimeZone: America/Iqaluit Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Jamaica Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Juneau Abbreviation: AKST secondsFromGMT: -32400

TimeZone: America/Kentucky/Louisville Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Kentucky/Monticello Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Kralendijk Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/La_Paz Abbreviation: GMT-4 secondsFromGMT: -14400

TimeZone: America/Lima Abbreviation: GMT-5 secondsFromGMT: -18000

TimeZone: America/Los_Angeles Abbreviation: PST secondsFromGMT: -28800

TimeZone: America/Lower_Princes Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Maceio Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Managua Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Manaus Abbreviation: GMT-4 secondsFromGMT: -14400

TimeZone: America/Marigot Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Martinique Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Matamoros Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Mazatlan Abbreviation: GMT-7 secondsFromGMT: -25200

TimeZone: America/Menominee Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Merida Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Metlakatla Abbreviation: AKST secondsFromGMT: -32400

TimeZone: America/Mexico_City Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Miquelon Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Moncton Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Monterrey Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Montevideo Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Montreal Abbreviation: GMT-5 secondsFromGMT: -18000

TimeZone: America/Montserrat Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Nassau Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/New_York Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Nipigon Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Nome Abbreviation: AKST secondsFromGMT: -32400

TimeZone: America/Noronha Abbreviation: GMT-2 secondsFromGMT: -7200

TimeZone: America/North_Dakota/Beulah Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/North_Dakota/Center Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/North_Dakota/New_Salem Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Ojinaga Abbreviation: MST secondsFromGMT: -25200

TimeZone: America/Panama Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Pangnirtung Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Paramaribo Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Phoenix Abbreviation: MST secondsFromGMT: -25200

TimeZone: America/Port-au-Prince Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Port_of_Spain Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Porto_Velho Abbreviation: GMT-4 secondsFromGMT: -14400

TimeZone: America/Puerto_Rico Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Punta_Arenas Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Rainy_River Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Rankin_Inlet Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Recife Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Regina Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Resolute Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Rio_Branco Abbreviation: GMT-5 secondsFromGMT: -18000

TimeZone: America/Santa_Isabel Abbreviation: GMT-8 secondsFromGMT: -28800

TimeZone: America/Santarem Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Santiago Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Santo_Domingo Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Sao_Paulo Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: America/Scoresbysund Abbreviation: GMT-1 secondsFromGMT: -3600

TimeZone: America/Shiprock Abbreviation: MST secondsFromGMT: -25200

TimeZone: America/Sitka Abbreviation: AKST secondsFromGMT: -32400

TimeZone: America/St_Barthelemy Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/St_Johns Abbreviation: GMT-3:30 secondsFromGMT: -12600

TimeZone: America/St_Kitts Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/St_Lucia Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/St_Thomas Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/St_Vincent Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Swift_Current Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Tegucigalpa Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Thule Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Thunder_Bay Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Tijuana Abbreviation: PST secondsFromGMT: -28800

TimeZone: America/Toronto Abbreviation: EST secondsFromGMT: -18000

TimeZone: America/Tortola Abbreviation: AST secondsFromGMT: -14400

TimeZone: America/Vancouver Abbreviation: PST secondsFromGMT: -28800

TimeZone: America/Whitehorse Abbreviation: PST secondsFromGMT: -28800

TimeZone: America/Winnipeg Abbreviation: CST secondsFromGMT: -21600

TimeZone: America/Yakutat Abbreviation: AKST secondsFromGMT: -32400

TimeZone: America/Yellowknife Abbreviation: MST secondsFromGMT: -25200

TimeZone: Antarctica/Casey Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Antarctica/Davis Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Antarctica/DumontDUrville Abbreviation: GMT+10 secondsFromGMT: 36000

TimeZone: Antarctica/Macquarie Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Antarctica/Mawson Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Antarctica/McMurdo Abbreviation: GMT+13 secondsFromGMT: 46800

TimeZone: Antarctica/Palmer Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: Antarctica/Rothera Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: Antarctica/South_Pole Abbreviation: GMT+13 secondsFromGMT: 46800

TimeZone: Antarctica/Syowa Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Antarctica/Troll Abbreviation: GMT secondsFromGMT: 0

TimeZone: Antarctica/Vostok Abbreviation: GMT+6 secondsFromGMT: 21600

TimeZone: Arctic/Longyearbyen Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Asia/Aden Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Asia/Almaty Abbreviation: GMT+6 secondsFromGMT: 21600

TimeZone: Asia/Amman Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Asia/Anadyr Abbreviation: GMT+12 secondsFromGMT: 43200

TimeZone: Asia/Aqtau Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Asia/Aqtobe Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Asia/Ashgabat Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Asia/Atyrau Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Asia/Baghdad Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Asia/Bahrain Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Asia/Baku Abbreviation: GMT+4 secondsFromGMT: 14400

TimeZone: Asia/Bangkok Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Asia/Barnaul Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Asia/Beirut Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Asia/Bishkek Abbreviation: GMT+6 secondsFromGMT: 21600

TimeZone: Asia/Brunei Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Calcutta Abbreviation: GMT+5:30 secondsFromGMT: 19800

TimeZone: Asia/Chita Abbreviation: GMT+9 secondsFromGMT: 32400

TimeZone: Asia/Choibalsan Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Chongqing Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Colombo Abbreviation: GMT+5:30 secondsFromGMT: 19800

TimeZone: Asia/Damascus Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Asia/Dhaka Abbreviation: GMT+6 secondsFromGMT: 21600

TimeZone: Asia/Dili Abbreviation: GMT+9 secondsFromGMT: 32400

TimeZone: Asia/Dubai Abbreviation: GMT+4 secondsFromGMT: 14400

TimeZone: Asia/Dushanbe Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Asia/Famagusta Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Asia/Gaza Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Asia/Harbin Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Hebron Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Asia/Ho_Chi_Minh Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Asia/Hong_Kong Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Hovd Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Asia/Irkutsk Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Jakarta Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Asia/Jayapura Abbreviation: GMT+9 secondsFromGMT: 32400

TimeZone: Asia/Jerusalem Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Asia/Kabul Abbreviation: GMT+4:30 secondsFromGMT: 16200

TimeZone: Asia/Kamchatka Abbreviation: GMT+12 secondsFromGMT: 43200

TimeZone: Asia/Karachi Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Asia/Kashgar Abbreviation: GMT+6 secondsFromGMT: 21600

TimeZone: Asia/Kathmandu Abbreviation: GMT+5:45 secondsFromGMT: 20700

TimeZone: Asia/Katmandu Abbreviation: GMT+5:45 secondsFromGMT: 20700

TimeZone: Asia/Khandyga Abbreviation: GMT+9 secondsFromGMT: 32400

TimeZone: Asia/Krasnoyarsk Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Asia/Kuala_Lumpur Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Kuching Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Kuwait Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Asia/Macau Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Magadan Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Asia/Makassar Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Manila Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Muscat Abbreviation: GMT+4 secondsFromGMT: 14400

TimeZone: Asia/Nicosia Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Asia/Novokuznetsk Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Asia/Novosibirsk Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Asia/Omsk Abbreviation: GMT+6 secondsFromGMT: 21600

TimeZone: Asia/Oral Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Asia/Phnom_Penh Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Asia/Pontianak Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Asia/Pyongyang Abbreviation: GMT+9 secondsFromGMT: 32400

TimeZone: Asia/Qatar Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Asia/Qostanay Abbreviation: GMT+6 secondsFromGMT: 21600

TimeZone: Asia/Qyzylorda Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Asia/Rangoon Abbreviation: GMT+6:30 secondsFromGMT: 23400

TimeZone: Asia/Riyadh Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Asia/Sakhalin Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Asia/Samarkand Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Asia/Seoul Abbreviation: GMT+9 secondsFromGMT: 32400

TimeZone: Asia/Shanghai Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Singapore Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Srednekolymsk Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Asia/Taipei Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Tashkent Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Asia/Tbilisi Abbreviation: GMT+4 secondsFromGMT: 14400

TimeZone: Asia/Tehran Abbreviation: GMT+3:30 secondsFromGMT: 12600

TimeZone: Asia/Thimphu Abbreviation: GMT+6 secondsFromGMT: 21600

TimeZone: Asia/Tokyo Abbreviation: GMT+9 secondsFromGMT: 32400

TimeZone: Asia/Tomsk Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Asia/Ulaanbaatar Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Asia/Urumqi Abbreviation: GMT+6 secondsFromGMT: 21600

TimeZone: Asia/Ust-Nera Abbreviation: GMT+10 secondsFromGMT: 36000

TimeZone: Asia/Vientiane Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Asia/Vladivostok Abbreviation: GMT+10 secondsFromGMT: 36000

TimeZone: Asia/Yakutsk Abbreviation: GMT+9 secondsFromGMT: 32400

TimeZone: Asia/Yangon Abbreviation: GMT+6:30 secondsFromGMT: 23400

TimeZone: Asia/Yekaterinburg Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Asia/Yerevan Abbreviation: GMT+4 secondsFromGMT: 14400

TimeZone: Atlantic/Azores Abbreviation: GMT-1 secondsFromGMT: -3600

TimeZone: Atlantic/Bermuda Abbreviation: AST secondsFromGMT: -14400

TimeZone: Atlantic/Canary Abbreviation: GMT secondsFromGMT: 0

TimeZone: Atlantic/Cape_Verde Abbreviation: GMT-1 secondsFromGMT: -3600

TimeZone: Atlantic/Faroe Abbreviation: GMT secondsFromGMT: 0

TimeZone: Atlantic/Madeira Abbreviation: GMT secondsFromGMT: 0

TimeZone: Atlantic/Reykjavik Abbreviation: GMT secondsFromGMT: 0

TimeZone: Atlantic/South_Georgia Abbreviation: GMT-2 secondsFromGMT: -7200

TimeZone: Atlantic/St_Helena Abbreviation: GMT secondsFromGMT: 0

TimeZone: Atlantic/Stanley Abbreviation: GMT-3 secondsFromGMT: -10800

TimeZone: Australia/Adelaide Abbreviation: GMT+10:30 secondsFromGMT: 37800

TimeZone: Australia/Brisbane Abbreviation: GMT+10 secondsFromGMT: 36000

TimeZone: Australia/Broken_Hill Abbreviation: GMT+10:30 secondsFromGMT: 37800

TimeZone: Australia/Currie Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Australia/Darwin Abbreviation: GMT+9:30 secondsFromGMT: 34200

TimeZone: Australia/Eucla Abbreviation: GMT+8:45 secondsFromGMT: 31500

TimeZone: Australia/Hobart Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Australia/Lindeman Abbreviation: GMT+10 secondsFromGMT: 36000

TimeZone: Australia/Lord_Howe Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Australia/Melbourne Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Australia/Perth Abbreviation: GMT+8 secondsFromGMT: 28800

TimeZone: Australia/Sydney Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Europe/Amsterdam Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Andorra Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Astrakhan Abbreviation: GMT+4 secondsFromGMT: 14400

TimeZone: Europe/Athens Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Europe/Belgrade Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Berlin Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Bratislava Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Brussels Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Bucharest Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Europe/Budapest Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Busingen Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Chisinau Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Europe/Copenhagen Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Dublin Abbreviation: GMT secondsFromGMT: 0

TimeZone: Europe/Gibraltar Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Guernsey Abbreviation: GMT secondsFromGMT: 0

TimeZone: Europe/Helsinki Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Europe/Isle_of_Man Abbreviation: GMT secondsFromGMT: 0

TimeZone: Europe/Istanbul Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Europe/Jersey Abbreviation: GMT secondsFromGMT: 0

TimeZone: Europe/Kaliningrad Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Europe/Kiev Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Europe/Kirov Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Europe/Lisbon Abbreviation: GMT secondsFromGMT: 0

TimeZone: Europe/Ljubljana Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/London Abbreviation: GMT secondsFromGMT: 0

TimeZone: Europe/Luxembourg Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Madrid Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Malta Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Mariehamn Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Europe/Minsk Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Europe/Monaco Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Moscow Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Europe/Oslo Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Paris Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Podgorica Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Prague Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Riga Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Europe/Rome Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Samara Abbreviation: GMT+4 secondsFromGMT: 14400

TimeZone: Europe/San_Marino Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Sarajevo Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Saratov Abbreviation: GMT+4 secondsFromGMT: 14400

TimeZone: Europe/Simferopol Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Europe/Skopje Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Sofia Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Europe/Stockholm Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Tallinn Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Europe/Tirane Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Ulyanovsk Abbreviation: GMT+4 secondsFromGMT: 14400

TimeZone: Europe/Uzhgorod Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Europe/Vaduz Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Vatican Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Vienna Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Vilnius Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Europe/Volgograd Abbreviation: GMT+4 secondsFromGMT: 14400

TimeZone: Europe/Warsaw Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Zagreb Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: Europe/Zaporozhye Abbreviation: GMT+2 secondsFromGMT: 7200

TimeZone: Europe/Zurich Abbreviation: GMT+1 secondsFromGMT: 3600

TimeZone: GMT Abbreviation: GMT secondsFromGMT: 0

TimeZone: Indian/Antananarivo Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Indian/Chagos Abbreviation: GMT+6 secondsFromGMT: 21600

TimeZone: Indian/Christmas Abbreviation: GMT+7 secondsFromGMT: 25200

TimeZone: Indian/Cocos Abbreviation: GMT+6:30 secondsFromGMT: 23400

TimeZone: Indian/Comoro Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Indian/Kerguelen Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Indian/Mahe Abbreviation: GMT+4 secondsFromGMT: 14400

TimeZone: Indian/Maldives Abbreviation: GMT+5 secondsFromGMT: 18000

TimeZone: Indian/Mauritius Abbreviation: GMT+4 secondsFromGMT: 14400

TimeZone: Indian/Mayotte Abbreviation: GMT+3 secondsFromGMT: 10800

TimeZone: Indian/Reunion Abbreviation: GMT+4 secondsFromGMT: 14400

TimeZone: Pacific/Apia Abbreviation: GMT+14 secondsFromGMT: 50400

TimeZone: Pacific/Auckland Abbreviation: GMT+13 secondsFromGMT: 46800

TimeZone: Pacific/Bougainville Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Pacific/Chatham Abbreviation: GMT+13:45 secondsFromGMT: 49500

TimeZone: Pacific/Chuuk Abbreviation: GMT+10 secondsFromGMT: 36000

TimeZone: Pacific/Easter Abbreviation: GMT-5 secondsFromGMT: -18000

TimeZone: Pacific/Efate Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Pacific/Enderbury Abbreviation: GMT+13 secondsFromGMT: 46800

TimeZone: Pacific/Fakaofo Abbreviation: GMT+13 secondsFromGMT: 46800

TimeZone: Pacific/Fiji Abbreviation: GMT+12 secondsFromGMT: 43200

TimeZone: Pacific/Funafuti Abbreviation: GMT+12 secondsFromGMT: 43200

TimeZone: Pacific/Galapagos Abbreviation: GMT-6 secondsFromGMT: -21600

TimeZone: Pacific/Gambier Abbreviation: GMT-9 secondsFromGMT: -32400

TimeZone: Pacific/Guadalcanal Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Pacific/Guam Abbreviation: GMT+10 secondsFromGMT: 36000

TimeZone: Pacific/Honolulu Abbreviation: HST secondsFromGMT: -36000

TimeZone: Pacific/Johnston Abbreviation: HAST secondsFromGMT: -36000

TimeZone: Pacific/Kiritimati Abbreviation: GMT+14 secondsFromGMT: 50400

TimeZone: Pacific/Kosrae Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Pacific/Kwajalein Abbreviation: GMT+12 secondsFromGMT: 43200

TimeZone: Pacific/Majuro Abbreviation: GMT+12 secondsFromGMT: 43200

TimeZone: Pacific/Marquesas Abbreviation: GMT-9:30 secondsFromGMT: -34200

TimeZone: Pacific/Midway Abbreviation: GMT-11 secondsFromGMT: -39600

TimeZone: Pacific/Nauru Abbreviation: GMT+12 secondsFromGMT: 43200

TimeZone: Pacific/Niue Abbreviation: GMT-11 secondsFromGMT: -39600

TimeZone: Pacific/Norfolk Abbreviation: GMT+12 secondsFromGMT: 43200

TimeZone: Pacific/Noumea Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Pacific/Pago_Pago Abbreviation: GMT-11 secondsFromGMT: -39600

TimeZone: Pacific/Palau Abbreviation: GMT+9 secondsFromGMT: 32400

TimeZone: Pacific/Pitcairn Abbreviation: GMT-8 secondsFromGMT: -28800

TimeZone: Pacific/Pohnpei Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Pacific/Ponape Abbreviation: GMT+11 secondsFromGMT: 39600

TimeZone: Pacific/Port_Moresby Abbreviation: GMT+10 secondsFromGMT: 36000

TimeZone: Pacific/Rarotonga Abbreviation: GMT-10 secondsFromGMT: -36000

TimeZone: Pacific/Saipan Abbreviation: GMT+10 secondsFromGMT: 36000

TimeZone: Pacific/Tahiti Abbreviation: GMT-10 secondsFromGMT: -36000

TimeZone: Pacific/Tarawa Abbreviation: GMT+12 secondsFromGMT: 43200

TimeZone: Pacific/Tongatapu Abbreviation: GMT+13 secondsFromGMT: 46800

TimeZone: Pacific/Truk Abbreviation: GMT+10 secondsFromGMT: 36000

TimeZone: Pacific/Wake Abbreviation: GMT+12 secondsFromGMT: 43200

TimeZone: Pacific/Wallis Abbreviation: GMT+12 secondsFromGMT: 43200

 How to get the list
run the below code

for tz in TimeZone.knownTimeZoneIdentifiers {
    let timeZone = TimeZone(identifier: tz)
    if let abbreviation = timeZone?.abbreviation(), let seconds = timeZone?.secondsFromGMT() {
        print ("TimeZone: \(tz) Abbreviation: \(abbreviation) secondsFromGMT: \(seconds)\n")
    }
}