Q:

Write a C# Sharp program to display the string representations of a date using the short date format specified for the ja-JP culture

0

Write a C# Sharp program to display the string representations of a date using the short date format specified for the ja-JP culture. 

Expected Output :

2016/05/12                                                                       
16/05/12                                                                         
16/5/12                                                                          
2016/5/12      

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;
public class Example26
{
  public static void Main(String[] argv){  
    DateTime may12 = new DateTime(2016, 5, 12, 5, 23, 15, 16);

IFormatProvider culture = 
	new System.Globalization.CultureInfo("ja-JP", true);
// Get the short date formats using the "ja-JP" culture.
string [] frenchmay12Formats = 
			may12.GetDateTimeFormats(culture);

// Display may12 in various formats using "ja-JP" culture.
foreach (string format in frenchmay12Formats) {
	Console.WriteLine(format);
}
  }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now