{"id":7184,"date":"2018-11-02T13:44:24","date_gmt":"2018-11-02T10:44:24","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/linux-zdump-command\/"},"modified":"2018-11-02T13:44:24","modified_gmt":"2018-11-02T10:44:24","slug":"linux-zdump-command-tutorial-for-beginners-with-examples","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/linux-zdump-command-tutorial-for-beginners-with-examples\/","title":{"rendered":"Linux zdump Command Tutorial for Beginners (with Examples)"},"content":{"rendered":"<p>With team members working from different countries nowadays, it sometimes becomes important to be aware of the timezone information for different locations. In general also, there may be situations wherein you may want to quickly see timezone for a particular location. You&#8217;ll be glad to know there&#8217;s a command line utility &#8211; dubbed <strong>zdump<\/strong> &#8211; that lets you do this.<\/p>\n<p>In this tutorial, we will discuss the basics of zdump using some easy to understand examples. But before we do that, it&#8217;s worth mentioning that all examples mentioned in this article have been tested on an Ubuntu 18.04 LTS machine.<\/p>\n<h2 id=\"linux-zdump-command\">Linux zdump command<\/h2>\n<p>The zdump command in Linux is basically a timezone dumping tool. Following is its syntax:<\/p>\n<p class=\"command\">zdump [&#8211;version] [&#8211;help] [-v] [-c [loyear,]hiyear] [zonename&#8230;]<\/p>\n<p>And here&#8217;s how the man page explains it:<\/p>\n<pre>The zdump program prints the current time in each zonename named on the command line.<\/pre>\n<p>Following are some examples that should give you a good idea on how the zdump command works.<\/p>\n<h2 id=\"q-how-to-use-zdump-command\">Q1. How to use zdump command?<\/h2>\n<p>Basic usage is fairly simple. Just execute &#8216;zdump&#8217; with the location name as input. For example:<\/p>\n<p class=\"command\">zdump Singapore<\/p>\n<p>Following is the output the command produced on my system:<\/p>\n<pre>Singapore\u00a0 Wed Oct 31 17:35:39 2018 +08<\/pre>\n<p>Here are some other examples:<\/p>\n<p><a class=\"fancybox\" id=\"img-zdump-basic-usage\" href=\"https:\/\/www.howtoforge.com\/images\/command-tutorial\/big\/zdump-basic-usage.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/linux-zdump-command-tutorial-for-beginners-with-examples.png\" alt=\"How to use zdump command\" width=\"341\" height=\"73\" title=\"\"><\/a><\/p>\n<p>It&#8217;s worth mentioning here that you can zdump to fetch city specific information. Following are some examples:<\/p>\n<p><a class=\"fancybox\" id=\"img-zdump-city\" href=\"https:\/\/www.howtoforge.com\/images\/command-tutorial\/big\/zdump-city.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/linux-zdump-command-tutorial-for-beginners-with-examples-1.png\" alt=\"Use zdump to fetch city specific information\" width=\"416\" height=\"111\" title=\"\"><\/a><\/p>\n<h2 id=\"q-how-to-make-zdump-produce-detailed-information-in-output\">Q2. How to make zdump produce detailed information in output?<\/h2>\n<p>In case you want zdump to produce detailed information, use the -v command line option. For example, the following command:<\/p>\n<p class=\"command\">zdump -v Singapore<\/p>\n<p>produced this output:<\/p>\n<pre>Singapore\u00a0 -9223372036854775808 = NULL<br\/>Singapore\u00a0 -9223372036854689408 = NULL<br\/>Singapore\u00a0 Mon Dec 31 17:04:34 1900 UT = Mon Dec 31 23:59:59 1900 LMT isdst=0 gmtoff=24925<br\/>Singapore\u00a0 Mon Dec 31 17:04:35 1900 UT = Tue Jan\u00a0 1 00:00:00 1901 SMT isdst=0 gmtoff=24925<br\/>Singapore\u00a0 Wed May 31 17:04:34 1905 UT = Wed May 31 23:59:59 1905 SMT isdst=0 gmtoff=24925<br\/>Singapore\u00a0 Wed May 31 17:04:35 1905 UT = Thu Jun\u00a0 1 00:04:35 1905 +07 isdst=0 gmtoff=25200<br\/>Singapore\u00a0 Sat Dec 31 16:59:59 1932 UT = Sat Dec 31 23:59:59 1932 +07 isdst=0 gmtoff=25200<br\/>Singapore\u00a0 Sat Dec 31 17:00:00 1932 UT = Sun Jan\u00a0 1 00:20:00 1933 +0720 isdst=1 gmtoff=26400<br\/>Singapore\u00a0 Tue Dec 31 16:39:59 1935 UT = Tue Dec 31 23:59:59 1935 +0720 isdst=1 gmtoff=26400<br\/>Singapore\u00a0 Tue Dec 31 16:40:00 1935 UT = Wed Jan\u00a0 1 00:00:00 1936 +0720 isdst=0 gmtoff=26400<br\/>Singapore\u00a0 Sun Aug 31 16:39:59 1941 UT = Sun Aug 31 23:59:59 1941 +0720 isdst=0 gmtoff=26400<br\/>Singapore\u00a0 Sun Aug 31 16:40:00 1941 UT = Mon Sep\u00a0 1 00:10:00 1941 +0730 isdst=0 gmtoff=27000<br\/>Singapore\u00a0 Sun Feb 15 16:29:59 1942 UT = Sun Feb 15 23:59:59 1942 +0730 isdst=0 gmtoff=27000<br\/>Singapore\u00a0 Sun Feb 15 16:30:00 1942 UT = Mon Feb 16 01:30:00 1942 +09 isdst=0 gmtoff=32400<br\/>Singapore\u00a0 Tue Sep 11 14:59:59 1945 UT = Tue Sep 11 23:59:59 1945 +09 isdst=0 gmtoff=32400<br\/>Singapore\u00a0 Tue Sep 11 15:00:00 1945 UT = Tue Sep 11 22:30:00 1945 +0730 isdst=0 gmtoff=27000<br\/>Singapore\u00a0 Thu Dec 31 16:29:59 1981 UT = Thu Dec 31 23:59:59 1981 +0730 isdst=0 gmtoff=27000<br\/>Singapore\u00a0 Thu Dec 31 16:30:00 1981 UT = Fri Jan\u00a0 1 00:30:00 1982 +08 isdst=0 gmtoff=28800<br\/>Singapore\u00a0 9223372036854689407 = NULL<br\/>Singapore\u00a0 9223372036854775807 = NULL<\/pre>\n<p>Here&#8217;s how the man page explains this option:<\/p>\n<pre>\u00a0-v\u00a0\u00a0 <br\/>For each zonename on the command line, print the time at the lowest possible time value, the time <br\/>one day after the lowest possible time value, the times both one second before and exactly at each <br\/>detected time discontinuity, the time at one day less than the highest possible time value, and <br\/>the time at the highest possible time value. Each line ends with isdst=1 if the given time is <br\/>Daylight Saving Time or isdst=0 otherwise.<\/pre>\n<h2 id=\"q-what-the-does-the-c-option-do\">Q3. What the does the -c option do?<\/h2>\n<p>The -c option cuts the verbose output near the start of the given year(s). Here&#8217;s how the man page explains it:<\/p>\n<pre readability=\"8\">-c [loyear,]hiyear<p>Cut off the verbose output near the start of the given year(s).\u00a0 The output still includes the <br\/>lowest\u00a0 possible\u00a0 time\u00a0 value and one day after it, and the highest possible time value preceded <br\/>by the time value one day before it.<\/p><\/pre>\n<p>Following is an example:<\/p>\n<p class=\"command\">zdump -v -c 1935 Singapore<\/p>\n<p>And here&#8217;s the output:<\/p>\n<pre>Singapore\u00a0 -9223372036854775808 = NULL<br\/>Singapore\u00a0 -9223372036854689408 = NULL<br\/>Singapore\u00a0 Mon Dec 31 17:04:34 1900 UT = Mon Dec 31 23:59:59 1900 LMT isdst=0 gmtoff=24925<br\/>Singapore\u00a0 Mon Dec 31 17:04:35 1900 UT = Tue Jan\u00a0 1 00:00:00 1901 SMT isdst=0 gmtoff=24925<br\/>Singapore\u00a0 Wed May 31 17:04:34 1905 UT = Wed May 31 23:59:59 1905 SMT isdst=0 gmtoff=24925<br\/>Singapore\u00a0 Wed May 31 17:04:35 1905 UT = Thu Jun\u00a0 1 00:04:35 1905 +07 isdst=0 gmtoff=25200<br\/>Singapore\u00a0 Sat Dec 31 16:59:59 1932 UT = Sat Dec 31 23:59:59 1932 +07 isdst=0 gmtoff=25200<br\/>Singapore\u00a0 Sat Dec 31 17:00:00 1932 UT = Sun Jan\u00a0 1 00:20:00 1933 +0720 isdst=1 gmtoff=26400<br\/>Singapore\u00a0 9223372036854689407 = NULL<br\/>Singapore\u00a0 9223372036854775807 = NULL<\/pre>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>Agreed, the zdump command is not the kind of tool that most of us will require everyday, but it&#8217;s a handy utility that you should know about, for you never know when you may be in need of it. More details about zdump can be accessed by heading to its <a href=\"https:\/\/linux.die.net\/man\/8\/zdump\" target=\"_blank\" rel=\"noopener noreferrer\">man page<\/a>.<\/p>\n<div class=\"authorbox\" readability=\"15\">\n<img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/linux-zdump-command-tutorial-for-beginners-with-examples.jpg\" alt=\"Himanshu Arora\" title=\"\"> <\/p>\n<p><strong>About Himanshu Arora<\/strong><\/p>\n<p>Himanshu Arora has been working on Linux since 2007. He carries professional experience in system level programming, networking protocols, and command line. In addition to HowtoForge, Himanshu&#8217;s work has also been featured in some of world&#8217;s other leading publications including Computerworld, IBM DeveloperWorks, and Linux Journal.<\/p>\n<\/div>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<p>\n<a href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Flinux-zdump-command%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/linux-zdump-command-tutorial-for-beginners-with-examples-2.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Flinux-zdump-command%2F&amp;text=Linux+zdump+Command+Tutorial+for+Beginners+%28with+Examples%29&amp;via=howtoforgecom&amp;related=howtoforgecom\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/linux-zdump-command-tutorial-for-beginners-with-examples-3.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/howtoforgecom\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/linux-zdump-command-tutorial-for-beginners-with-examples-4.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/plus.google.com\/share?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Flinux-zdump-command%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/11\/linux-zdump-command-tutorial-for-beginners-with-examples-5.png\" height=\"20\" alt=\"\" title=\"\"><\/a>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>With team members working from different countries nowadays, it sometimes becomes important to be aware of the timezone information for different locations. In general also, there may be situations wherein you may want to quickly see timezone for a particular location. You&#8217;ll be glad to know there&#8217;s a command line utility &#8211; dubbed zdump &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-7184","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=7184"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7184\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=7184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=7184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=7184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}