diff -Naur wmcalclock-1.25/Src/wmCalClock.1 wmcalclock-1.25-rwbarton/Src/wmCalClock.1 --- wmcalclock-1.25/Src/wmCalClock.1 2005-01-29 10:16:35.000000000 +0000 +++ wmcalclock-1.25-rwbarton/Src/wmCalClock.1 2005-01-29 10:30:06.000000000 +0000 @@ -25,6 +25,11 @@ .B \-24 Show time in 24-hour format instead of default 12-hour AM/PM format. .TP +.B \-30 +Show local time in 30-hour format. Times between midnight and 6 AM +are displayed as belonging to the previous day, so the hour ranges +from 6 to 29. +.TP .B \-g Show Greenwich Mean Time (GMT). .TP diff -Naur wmcalclock-1.25/Src/wmCalClock.c wmcalclock-1.25-rwbarton/Src/wmCalClock.c --- wmcalclock-1.25/Src/wmCalClock.c 2005-01-29 10:06:31.000000000 +0000 +++ wmcalclock-1.25-rwbarton/Src/wmCalClock.c 2005-01-29 10:31:11.000000000 +0000 @@ -259,6 +259,7 @@ int yAMPM = 95; int ydAMPM = 6; int Show24HourTime = 0; +int Show30HourTime = 0; int ShowGreenwichTime = 0; int ShowSiderealTime = 0; double Longitude; @@ -502,6 +503,26 @@ gmst = (gmst - (double)Mins)*60.0; Secs = (int)gmst; + } else if (Show30HourTime){ + + CurrentLocalTime = time(CurrentTime); + Time = localtime(&CurrentLocalTime); + + /* Careful. Need to handle daylight savings time changes correctly. */ + if (Time->tm_hour < 6){ + int old_hour = Time->tm_hour; + time_t new_time = CurrentLocalTime - 12 * 60 * 60; + Time = localtime(&new_time); + Time->tm_hour = old_hour + 24; + } + + DayOfMonth = Time->tm_mday-1; + DayOfWeek = Time->tm_wday; + Month = Time->tm_mon; + Hours = Time->tm_hour; + Mins = Time->tm_min; + Secs = Time->tm_sec; + } else { CurrentLocalTime = time(CurrentTime); @@ -803,6 +824,11 @@ Show24HourTime = 1; + } else if (!strcmp(argv[i], "-30")){ + + Show24HourTime = 1; /* Don't display AM/PM */ + Show30HourTime = 1; + } else if (!strcmp(argv[i], "-b")){ if ((i+1 >= argc)||(argv[i+1][0] == '-')) { @@ -883,6 +909,7 @@ printf("\t-e \"Command\"\tCommand to execute via double click of mouse button 1.\n"); printf("\t-S\t\tDo not show seconds.\n"); printf("\t-24\t\tShow 24-hour time. Default is 12 hour AM/PM Time.\n"); + printf("\t-30\t\tShow 30-hour local time (hour ranges from 6 to 29).\n"); printf("\t-g\t\tShow Greenwich time.\n"); printf("\t-s\t\tShow Greenwich Mean Sidereal Time (GMST) in 24-hour format. \n"); printf("\t-L \tShow Local Sidereal Time (LST) in 24-hour format. \n");