docker ubuntu 设置时区
root@c0035d371ca4:/mydata# apt-get install tzdataReading package lists... DoneBuilding dependency treeReading state information... DoneThe following NEW packages will be installed:tzdata...
·
root@c0035d371ca4:/mydata# apt-get install tzdata
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
tzdata
0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded.
Need to get 190 kB of archives.
After this operation, 3106 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 tzdata all 2019b-0ubuntu0.18.04 [190 kB]
Fetched 190 kB in 1s (328 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package tzdata.
(Reading database ... 22884 files and directories currently installed.)
Preparing to unpack .../tzdata_2019b-0ubuntu0.18.04_all.deb ...
Unpacking tzdata (2019b-0ubuntu0.18.04) ...
Setting up tzdata (2019b-0ubuntu0.18.04) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Configuring tzdata
------------------
Please select the geographic area in which you live. Subsequent configuration questions will narrow this down by presenting a
list of cities, representing the time zones in which they are located.
1. Africa 3. Antarctica 5. Arctic 7. Atlantic 9. Indian 11. SystemV 13. Etc
2. America 4. Australia 6. Asia 8. Europe 10. Pacific 12. US
Geographic area: 6
Please select the city or region corresponding to your time zone.
1. Aden 14. Beirut 27. Gaza 40. Karachi 53. Muscat 66. Riyadh 79. Tokyo
2. Almaty 15. Bishkek 28. Harbin 41. Kashgar 54. Nicosia 67. Sakhalin 80. Tomsk
3. Amman 16. Brunei 29. Hebron 42. Kathmandu 55. Novokuznetsk 68. Samarkand 81. Ujung_Pandang
4. Anadyr 17. Chita 30. Ho_Chi_Minh 43. Khandyga 56. Novosibirsk 69. Seoul 82. Ulaanbaatar
5. Aqtau 18. Choibalsan 31. Hong_Kong 44. Kolkata 57. Omsk 70. Shanghai 83. Urumqi
6. Aqtobe 19. Chongqing 32. Hovd 45. Krasnoyarsk 58. Oral 71. Singapore 84. Ust-Nera
7. Ashgabat 20. Colombo 33. Irkutsk 46. Kuala_Lumpur 59. Phnom_Penh 72. Srednekolymsk 85. Vientiane
8. Atyrau 21. Damascus 34. Istanbul 47. Kuching 60. Pontianak 73. Taipei 86. Vladivostok
9. Baghdad 22. Dhaka 35. Jakarta 48. Kuwait 61. Pyongyang 74. Tashkent 87. Yakutsk
10. Bahrain 23. Dili 36. Jayapura 49. Macau 62. Qatar 75. Tbilisi 88. Yangon
11. Baku 24. Dubai 37. Jerusalem 50. Magadan 63. Qostanay 76. Tehran 89. Yekaterinburg
12. Bangkok 25. Dushanbe 38. Kabul 51. Makassar 64. Qyzylorda 77. Tel_Aviv 90. Yerevan
13. Barnaul 26. Famagusta 39. Kamchatka 52. Manila 65. Rangoon 78. Thimphu
Time zone: 70
Current default time zone: 'Asia/Shanghai'
Local time is now: Mon Jul 22 16:24:28 CST 2019.
Universal Time is now: Mon Jul 22 08:24:28 UTC 2019.
Run 'dpkg-reconfigure tzdata' if you wish to change it.
root@c0035d371ca4:/mydata# python
-bash: python: command not found
root@c0035d371ca4:/mydata# python3
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.now()
datetime.datetime(2019, 7, 22, 16, 24, 50, 759949)
更多推荐
已为社区贡献3条内容
所有评论(0)