Library code snippets
How to display a date in a specific language
By Edward Tanguay, published on 01 Aug 2003
I do some of my developing on German servers which was always a drag when it came to formatting dates. With .NET you can set the culture info and it is taken care of automatically for you. Nice.
// using System.Globalization // stick this at the top of your class
CultureInfo ci = new CultureInfo("en-US");
DateTime dt = DateTime.Now;
Response.Write(dt.ToString("f",ci));
Response.Write("<br><br>");
DateTime dt2 = DateTime.MinValue;
Response.Write(dt2.ToString("f",ci));
Related articles
Related discussion
-
Help me how to dynamic create row column of TableLayoutpanel at run time ??????
by anatha1 (0 replies)
-
Very Urgent regarding deleting the images from a folder
by rameshbandi (2 replies)
-
How to Export Datagridview contents to Excel
by BarbaMariolino (8 replies)
-
Help accessing sound card
by daz4904 (0 replies)
-
How to Write a GPS Application
by stoyac (19 replies)
Related podcasts
-
Object-Oriented Programming in Ruby
In this episode, I talk with Scott Bellware about object-oriented programming in Ruby, and Ruby's object model. This is taken from a private conversation, and the audio quality suffers at times. Much thanks to Scott for allowing this to be released.This episode of the Alt.NET Podcast is bro...
This thread is for discussions of How to display a date in a specific language.