CSharp - Write program to Display the Month in Text


Write a program to display the current date with the month presented by text rather than by a number.


You can achieve this task using the ToLongDateString action of the DateTime object.

The month name displayed by the ToLongDateString method depends on the operating system language setting.


using System;

class Program/*from ww  w.java  2  s . c  om*/
    static void Main(string[] args)
        // Today's date 
        DateTime today = DateTime.Today;

        // Output 
        Console.WriteLine("Today is " + today.ToLongDateString());