Home > Article, C# > Datetime Format Indonesia C#

Datetime Format Indonesia C#


datetime_format_indonesiaBagaimana 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);
}

 

datetime_format_indonesia

  1. August 9, 2016 at 1:17 pm

    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

    • August 9, 2016 at 1:29 pm

      Terimakasih tambahan infonya.😂…

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: