View Problem

Display information about a date

Display the day of month, day of year, month name and day name of the day 8 days from now.
DiskEdit
ruby
require 'date'

next_week = Date.today + 8

puts next_week.day # day of month
puts next_week.yday # day of year
puts next_week.strftime('%B') # month name
puts next_week.strftime('%A') # day name
DiskEdit
csharp
DateTime date = DateTime.Today.AddDays(8);

Console.WriteLine("Day of month: " + date.Day);
Console.WriteLine("Day of year: " + date.DayOfYear);
Console.WriteLine("Month name: " + date.ToString("MMMM"));
Console.WriteLine("Day name: " + date.ToString("dddd"));

// The two ToString calls will use the current locale.
// To get localised month and day names, see http://msdn.microsoft.com/en-us/library/8tfzyc64.aspx
ExpandDiskEdit
clojure
(let [cal (Calendar/getInstance)]
(.add cal Calendar/DAY_OF_YEAR 8)
(println (.format (SimpleDateFormat. "d, D, MMMM, EEEE")
(.getTime cal))))
ExpandDiskEdit
cpp Qt 4.x
QDate dateEightDaysFromNow = QDate::currentDate().addDays(8);

Submit a new solution for ruby, csharp, clojure, or cpp
There are 12 other solutions in additional languages (fantom, fsharp, go, groovy ...)