Sample Header Ad - 728x90

First and last day of a month

14 votes
5 answers
74185 views
Given two numbers, month and year, how can I compute the first and the last day of that month ? My goal is to output these three lines: 1. month / year (month in textual form but that is trivial) 2. for each day of the month: name of the day of the week for the current day: Fri. & Sat. & Sun. [...] 3. day number within the month: 1 & 2 & 3 [...] & 28 & .. ? I'm looking for a solution using GNU date or BSD date (on OS X).
Asked by alecail (1663 rep)
Jul 17, 2012, 09:28 AM
Last activity: Sep 11, 2022, 05:36 AM