A Turquia decidiu permanecer permanentemente ao mesmo tempo.
DST ended on Thursday, 8 September 2016, 00:00:00. Clocks were not changed.
A Turquia está entre +2 e +3 UTC, então agora ele ficará em +3. Veja aqui .
Há uma discussão sobre StackOverflow , mas eu tenho um aplicativo no Spring Boot em um Ubuntu máquina. É assim que eu tiro minha data:
cmntWrapper.setCreatedAtString(cmnt.getCreatedAt().
now(ZoneId.of(Constants.TURKEY_ZONE)).
format(DateTimeFormatter.ofPattern(Constants.DATE_TIME_FORMAT)));
Isso mostra a hora como 13,50, mas na verdade é 14,50, porque estamos em +3.
O que posso fazer?
Eu não quero usar o UTC +3 porque eles podem dizer no ano que vem, "vamos usar novamente para + 2- + 3 mudando para o conceito de horário de verão". Então não posso arriscar.
Não posso alterar o código nas próximas semanas. Ele permanecerá permanente depois de algumas semanas.
O que você sugere para permanente?
A IANA sugere isso :
java -jar tzupdater.jar options
Mas isso não funciona:
root@vegan:/home/vegan/Downloads/tzdb# java -jar tzdata-latest.tar.gz Error: Invalid or corrupt jarfile tzdata-latest.tar.gz
Essa é a minha jva
root@vegan:/usr/bin# whereis java
java: /usr/bin/java /usr/share/java /usr/share/man/man1/java.1.gz
Quando tento fazer nesse diretório
root@vegan:/usr/bin# java -jar tzupdater.jar -u -l http://www.iana.org/time-zones/repository/tzdata-latest.tar.gz
Recebi erro para a versão e não consigo instalar tz
:
vegan@vegan:~$ sudo apt-get update
[sudo] password for vegan:
Hit:1 http://tr.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://tr.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://tr.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:5 http://ppa.launchpad.net/apandada1/brightness-controller/ubuntu
xenial InRelease Ign:6 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial InRelease Ign:7
http://dl.google.com/linux/chrome/deb stable InRelease
Hit:8 http://ppa.launchpad.net/notepadqq-team/notepadqq/ubuntu xenial
InRelease Hit:9 http://repo.yandex.ru/yandex-browser/deb beta
InRelease Hit:10
http://dl.google.com/linux/chrome/deb stable Release
Hit:11 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial
InRelease Ign:12 http://ppa.launchpad.net/midori/ppa/ubuntu xenial
Release Hit:13 https://deb.opera.com/opera-stable stable InRelease
Ign:14 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main amd64
Packages Hit:16 https://apt.dockerproject.org/repo ubuntu-xenial
InRelease Ign:17 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial/main i386 Packages Ign:18
http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main all Packages
Ign:19 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main
Translation-en_US Ign:20 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial/main Translation-en Hit:21 https://deb.nodesource.com/node_5.x
xenial InRelease Ign:22 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial/main amd64 DEP-11 Metadata Ign:23
http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main DEP-11 64x64
Icons Ign:14 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main
amd64 Packages Ign:17 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial/main i386 Packages Ign:18
http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main all Packages
Ign:19 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main
Translation-en_US Ign:20 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial/main Translation-en Ign:22
http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main amd64 DEP-11
Metadata Ign:23 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main
DEP-11 64x64 Icons Ign:14 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial/main amd64 Packages Ign:17
http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main i386 Packages
Ign:18 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main all
Packages Ign:19 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main
Translation-en_US Ign:20 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial/main Translation-en Ign:22
http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main amd64 DEP-11
Metadata Ign:23 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main
DEP-11 64x64 Icons Ign:14 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial/main amd64 Packages Ign:17
http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main i386 Packages
Ign:18 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main all
Packages Ign:19 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main
Translation-en_US Ign:20 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial/main Translation-en Ign:22
http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main amd64 DEP-11
Metadata Ign:23 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main
DEP-11 64x64 Icons Ign:14 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial/main amd64 Packages Ign:17
http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main i386 Packages
Ign:18 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main all
Packages Ign:19 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main
Translation-en_US Ign:20 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial/main Translation-en Ign:22
http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main amd64 DEP-11
Metadata Ign:23 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main
DEP-11 64x64 Icons Err:14 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial/main amd64 Packages 404 Not Found Ign:17
http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main i386 Packages
Ign:18 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main all
Packages Ign:19 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main
Translation-en_US Ign:20 http://ppa.launchpad.net/midori/ppa/ubuntu
xenial/main Translation-en Ign:22
http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main amd64 DEP-11
Metadata Ign:23 http://ppa.launchpad.net/midori/ppa/ubuntu xenial/main
DEP-11 64x64 Icons Reading package lists... Done W: Target Packages
(main/binary-amd64/Packages) is configured multiple times in
/etc/apt/sources.list.d/yandex-browser-beta.list:3 and
/etc/apt/sources.list.d/yandex-browser.list:1 W: Target Packages
(main/binary-all/Packages) is configured multiple times in
/etc/apt/sources.list.d/yandex-browser-beta.list:3 and
/etc/apt/sources.list.d/yandex-browser.list:1 W: Target Translations
(main/i18n/Translation-en_US) is configured multiple times in
/etc/apt/sources.list.d/yandex-browser-beta.list:3 and
/etc/apt/sources.list.d/yandex-browser.list:1 W: Target Translations
(main/i18n/Translation-en) is configured multiple times in
/etc/apt/sources.list.d/yandex-browser-beta.list:3 and
/etc/apt/sources.list.d/yandex-browser.list:1 W: Target DEP-11
(main/dep11/Components-amd64.yml) is configured multiple times in
/etc/apt/sources.list.d/yandex-browser-beta.list:3 and
/etc/apt/sources.list.d/yandex-browser.list:1 W: Target DEP-11-icons
(main/dep11/icons-64x64.tar) is configured multiple times in
/etc/apt/sources.list.d/yandex-browser-beta.list:3 and
/etc/apt/sources.list.d/yandex-browser.list:1 W: The repository
'http://ppa.launchpad.net/midori/ppa/ubuntu xenial Release' does not
have a Release file. N: Data from such a repository can't be
authenticated and is therefore potentially dangerous to use. N: See
apt-secure(8) manpage for repository creation and user configuration
details. E: Failed to fetch
http://ppa.launchpad.net/midori/ppa/ubuntu/dists/xenial/main/binary-amd64/Packages
404 Not Found E: Some index files failed to download. They have been
ignored, or old ones used instead. W: Target Packages
(main/binary-amd64/Packages) is configured multiple times in
/etc/apt/sources.list.d/yandex-browser-beta.list:3 and
/etc/apt/sources.list.d/yandex-browser.list:1 W: Target Packages
(main/binary-all/Packages) is configured multiple times in
/etc/apt/sources.list.d/yandex-browser-beta.list:3 and
/etc/apt/sources.list.d/yandex-browser.list:1 W: Target Translations
(main/i18n/Translation-en_US) is configured multiple times in
/etc/apt/sources.list.d/yandex-browser-beta.list:3 and
/etc/apt/sources.list.d/yandex-browser.list:1 W: Target Translations
(main/i18n/Translation-en) is configured multiple times in
/etc/apt/sources.list.d/yandex-browser-beta.list:3 and
/etc/apt/sources.list.d/yandex-browser.list:1 W: Target DEP-11
(main/dep11/Components-amd64.yml) is configured multiple times in
/etc/apt/sources.list.d/yandex-browser-beta.list:3 and
/etc/apt/sources.list.d/yandex-browser.list:1 W: Target DEP-11-icons
(main/dep11/icons-64x64.tar) is configured multiple times in
/etc/apt/sources.list.d/yandex-browser-beta.list:3 and
/etc/apt/sources.list.d/yandex-browser.list:1
vegan@vegan:~$ sudo apt-get upgrade tzdata tzdata-java
Reading package lists... Done
Building dependency tree
Reading state information... Done E:
Unable to locate package tzdata-java
também para
vegan@vegan:~$ sudo apt-get install tzdata-java
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package tzdata-java
e também como posso fazer java? porque para minha máquina linux de teste, veja isso por favor
puapp@PU-APP-01:~$ java -jar tzupdater.jar -u -l https://www.iana.org/time-zones/repository/releases/tzdata2015g.tar.gz
The program 'java' can be found in the following packages:
* default-jre
* gcj-4.8-jre-headless
* openjdk-7-jre-headless
* gcj-4.6-jre-headless
* openjdk-6-jre-headless
Try: sudo apt-get install <selected package>
Portanto, o JRE não está instalado, mas o aplicativo está ativo agora. Então, o que posso fazer agora? Se eu instalar o JRE, o que muda? Quando executo date
, mostra o tempo correto já no console. Eu gerenciei este aplicativo com o Docker.
puapp@PU-APP-01:~$ java version
The program 'java' can be found in the following packages:
* default-jre
* gcj-4.8-jre-headless
* openjdk-7-jre-headless
* gcj-4.6-jre-headless
* openjdk-6-jre-headless
Try: sudo apt-get install <selected package>
puapp@PU-APP-01:~$ whereis java
java: /usr/share/java
Mas no local eu tenho o java.
vegan@vegan:~$ java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
mas local não é importante. esse servidor linux é imenso.
e para a nossa máquina principal, existe o java
produp@Produp-app-01:~$ java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
produp@Produp-app-01:~$
Agora, a hora é 00,44. Quando eu corro
vegan@vegan:/usr/bin/tzdb$ date
Cum Kas 4 00:44:47 +03 2016
Retorna a hora correta, mas no aplicativo a hora ainda é 1 hora depois. Não sei se sempre a hora estava correta. Se o console mostrar a hora verdadeira, o que pode tzdata
fazer no aplicativo?