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
-
Query Tool to Excel using C# and .NET
by BarbaMariolino (1 replies)
-
looking for help on asp
by cladironbeard (2 replies)
-
Socket Programming in C# - Part 1
by graumanoz (23 replies)
-
LINQ in Action
by naser1 (0 replies)
-
Creating a Windows Service in VB.NET
by Templario55 (107 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...
Events coming up
-
Aug
28
St. Louis Day of .NET
St. Charles, United States
Technical conference with be 2 full days of content with over 40 sessions from local and national speakers, with topics such as:•.NET languages: C#, VB.NET•Technologies: WPF, Silverlight, WCF•Development tools: Visual Studio, TFS, Expression Blend
This thread is for discussions of How to display a date in a specific language.