I am trying to get mono (Debian 2.10.8.1-5) to run properly on my raspberry pi with the raspbian distro (\"Debian GNU/Linux wheezy/sid\"). I have installed mono with apt-get
I can't reproduce your issue on Windows (don't have raspberry, but your subject says Mono
).
I copied and pasted your exact source for Main()
into a new Mono console app (Mono 2.6.1), added a single line (Console.ReadLine();
), and ran it:
using System;
namespace TestDateTimeNow
{
class MainClass
{
public static void Main (string[] args)
{
DateTime now = DateTime.Now;
Console.WriteLine("Year: " + now.Year);
Console.WriteLine("Month: " + now.Month);
Console.WriteLine("Day: " + now.Day);
Console.WriteLine("DayOfWeek: " + now.DayOfWeek);
Console.WriteLine("DateTime.Now: " + DateTime.Now);
Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd"));
Console.ReadLine();
}
}
}
I get the output below: