Datetime Format Indonesia C#

Bagaimana caranya menginginkan format datetime pada c# menghasilkan dalam bahasa indonesia…?

Cara agar menghasilkan nama Hari maupun Bulan dalam bahasa indonesia menggunakan C#

public void formatindonesia()
{
string[] hari = { “Minggu”, “Senin”, “Selasa”, “Rabu”, “Kamis”, “Jumat”, “Sabtu” };
string[] bulan = { “Januari”, “Februari”, “Maret”, “April”, “Mei”, “Juni”, “Juli”, “Agustus”, “September”, “Oktober”, “Nopember”, “Desember” };

string hariIni = hari[(int)DateTime.Today.DayOfWeek];
string bulanIni = bulan[DateTime.Today.Month];
string TglIndonesia = string.Format(“{0}, {1}-{2}-{3}”, hariIni, DateTime.Today.Day, bulanIni, DateTime.Today.Year);
}

2 Responses to “Datetime Format Indonesia C#”

  1. dear mas indra terima kasih sharingnya, saya punya alternatif yang lebih ringkas

    lblTglSuratKeluar.Text = suratKeluarc.TglSurat.ToString(“dd MMMM yyyy”, new System.Globalization.CultureInfo(“id-ID”));

    sumber:
    http://stackoverflow.com/questions/26376318/how-to-set-name-of-month-with-indonesian-language-using-culture-types

Leave a Reply

Your email address will not be published. Required fields are marked *