How many days are in this month? 1. Given a function called day_of_month() that takes a UTC time value as input and returns a number from 1 to 31 which represents the day of the month of the UTC passed in. 2. Given a variable called t in which the UTC value (number of seconds since January, 1, 1970, GMT) is stored for any date/time that falls within this month. 3. Given the fact that there are 86400 seconds in a day. Days in this month = 32 - day_of_month((32 - day_of_month(t)) * 86400 + t) ^------------------^ \____________ Number of days to add to the current day number to ensure crossing over to next month and always land on the "32nd day" of this month. PERL example: #!/usr/bin/perl $utc = time(); print "There are ".dim($utc)." days in this month.\n"; sub dom { my ($utc) = @_; my (@tp); @tp = localtime($utc); return $tp[3]; } sub dim { my ($utc) = @_; return 32-dom((32-dom($utc))*86400+$utc); }