Jump to content

Day of the week: Difference between revisions

→‎{{header|D}}: D2's standard library is still changing
(→‎{{header|D}}: D2's standard library is still changing)
Line 415:
 
=={{header|D}}==
{{works with|D|2}}
<lang d>import std.stdio, std.datedatetime, std.conv;
 
void main() {
forforeach (int year =; 2008; year.. <= 2121; year++2122)
if (0 == weekDayDate.fromSimpleString(parse("December 25, " ~ to!string(year) ~ "-Dec-25").dayOfWeek()) {
writefln("Christmas comes on a sunday in %d", year);
}
}</lang>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.