CSharp examples for Language Basics:Date Time
Output Spanish day of week
using System;//ww w . j a va2 s. c o m using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { DateTime enteredDate = DateTime.Now; // Finding day of week (in enumeration) DayOfWeek dayOfWeek = enteredDate.DayOfWeek; // Spanish texts string spanish = ""; if (dayOfWeek == DayOfWeek.Monday) spanish = "Lunes"; if (dayOfWeek == DayOfWeek.Tuesday) spanish = "Martes"; if (dayOfWeek == DayOfWeek.Wednesday) spanish = "Miercoles"; if (dayOfWeek == DayOfWeek.Thursday) spanish = "Jueves"; if (dayOfWeek == DayOfWeek.Friday) spanish = "Viernes"; if (dayOfWeek == DayOfWeek.Saturday) spanish = "S?bado"; if (dayOfWeek == DayOfWeek.Sunday) spanish = "Domingo"; } }