Date formatting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I use (DateTime.Today).ToLongDateString(). I work in a danish company and
therefore many of the machines are set to this language resulting in danish
'dates'. However all our clients use english. Is there a way to get the
english translation of ToLongDateString() without setting the environment to
english?

Jesper, DK
 
Jesper said:
I use (DateTime.Today).ToLongDateString(). I work in a danish company
and therefore many of the machines are set to this language resulting
in danish 'dates'. However all our clients use english. Is there a
way to get the english translation of ToLongDateString() without
setting the environment to english?

Use:

CultureInfo ci = CultureInfo.CreateSpecificCulture("en-GB");

DateTime dt = ...;
string formatted = dt.ToString ("D", ci);
 
Back
Top