MCPcopy Create free account
hub / github.com/eggert/tz / show

Function show

zdump.c:785–822  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

783}
784
785static void
786show(timezone_t tz, char *zone, time_t t, bool v)
787{
788 register struct tm * tmp;
789 register struct tm * gmtmp;
790 struct tm tm, gmtm;
791
792 printf("%-*s ", longest, zone);
793 if (v) {
794 gmtmp = my_gmtime_r(&t, &gmtm);
795 if (gmtmp == NULL) {
796 printf(tformat(), t);
797 printf(_(" (gmtime failed)"));
798 } else {
799 dumptime(gmtmp);
800 printf(" UT");
801 }
802 printf(" = ");
803 }
804 tmp = localtime_rz(tz, &t, &tm);
805 if (tmp == NULL) {
806 printf(tformat(), t);
807 printf(_(" (localtime failed)"));
808 } else {
809 dumptime(tmp);
810 if (*abbr(tmp) != '\0')
811 printf(" %s", abbr(tmp));
812 if (v) {
813 long off = gmtoff(tmp, NULL, gmtmp);
814 printf(" isdst=%d", tmp->tm_isdst);
815 if (off != LONG_MIN)
816 printf(" gmtoff=%ld", off);
817 }
818 }
819 printf("\n");
820 if (tmp != NULL && *abbr(tmp) != '\0')
821 abbrok(abbr(tmp), zone);
822}
823
824/* Show timestamps just before and just after a transition between
825 defined and undefined (or vice versa) in either localtime or

Callers 2

mainFunction · 0.85
showextremaFunction · 0.85

Calls 7

my_gmtime_rFunction · 0.85
tformatFunction · 0.85
dumptimeFunction · 0.85
abbrFunction · 0.85
gmtoffFunction · 0.85
abbrokFunction · 0.85
localtime_rzFunction · 0.70

Tested by

no test coverage detected