fork(1) download
  1. //csc Ymd.cs
  2. using System;
  3. using System.Threading;
  4. using System.Globalization;
  5.  
  6. class Program{
  7. static void Main(){
  8. Thread.CurrentThread.CurrentCulture = new CultureInfo("vi-VN"); //Vietnamese
  9. //
  10. DateTime ymd = new DateTime(2015, 11, 21);//Year, Month, Day
  11. //string kq = ymd.ToString("Y"); //Year : "Tháng Mười Một 2015"
  12. string kq = ymd.ToString("M"); //Month : "21 Tháng Mười Một"
  13. //"Tháng Mười Một 2015"
  14. Console.WriteLine("Ngày 21/11/2015, netFx dịch (Culture + fmt):");
  15. Console.WriteLine(kq);
  16. Console.WriteLine("\nSTT === Char === Code(decimal).");
  17. //Console.WriteLine("STT === Char === Code(Hex).");
  18. for (int i = 0; i < kq.Length; i++)
  19. Console.WriteLine("{0,2:d} {1,8:c} {2,10:d}", i, kq[i], (int)kq[i]);
  20. //Console.WriteLine("{0,2:d} {1,8:c} {2,10:X}", i, kq[i], (int)kq[i]);
  21. Console.Write("\nDone, press enter to quit ..");Console.ReadLine();
  22. }
  23. }
  24.  
Success #stdin #stdout 0.01s 29808KB
stdin
Standard input is empty
stdout
Ngày 21/11/2015, netFx dịch (Culture + fmt):
21 tháng 11

STT === Char === Code(decimal).
 0        2         50
 1        1         49
 2                  32
 3        t        116
 4        h        104
 5        á        225
 6        n        110
 7        g        103
 8                  32
 9        1         49
10        1         49

Done, press enter to quit ..