int'l date

  • Thread starter Thread starter vinnie
  • Start date Start date
V

vinnie

I'm trying to use the time & date method for get it shown on te page,
but if i use the standadr format it works, while if i change it as
follow, i get two error messages:

System.Globalization.CultureInfo culture = new
System.Globalization.CultureInfo();
System.Globalization.CultureInfo("pl-PL");

LabelData.Text = String.Format(culture.DateTimeFormat,"Today is
{0:dd}, {0:MMMM} {0:yyyy}, {0:HH} {0:mm} {0:ss}", DateTime.Now);


The errors are:
- No overload for method 'CultureInfo' takes '0' arguments;
-'System.Globalization.CultureInfo' is a 'type', which is not valid in
the given context;


What should i change to make it working properly?

Thanks
 
vinnie said:
I'm trying to use the time & date method for get it shown on te page,
but if i use the standadr format it works, while if i change it as
follow, i get two error messages:

System.Globalization.CultureInfo culture = new
System.Globalization.CultureInfo();
System.Globalization.CultureInfo("pl-PL");

LabelData.Text = String.Format(culture.DateTimeFormat,"Today is
{0:dd}, {0:MMMM} {0:yyyy}, {0:HH} {0:mm} {0:ss}", DateTime.Now);


The errors are:
- No overload for method 'CultureInfo' takes '0' arguments;
-'System.Globalization.CultureInfo' is a 'type', which is not valid in
the given context;


What should i change to make it working properly?

Thanks
Use the CultureInfo.GetCulture(string name) method or new
CultureInfo(string name) constructor.
System.Globalization.CultureInfo culture = new
System.Globalization.CultureInfo("pl-PL");
//System.Globalization.CultureInfo("pl-PL");

JB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top