Search code examples
c#.netwindowsrdlcdate-format

How to Display, Local System Date Format in RDLC Field


Hi

Please Help

I Have RDLC Report, in that i have TransactionDate(which displays in the format of 5/25/2017) and my Local system date format is 25-05-2017. Now i want to display, that RDLC Field (TransactionDate) should be same as Local System Date.

Thanks In Advance.


Solution

  • I guess you want your date time in this format < Day-Month-Year > Well it's simple

            DateTime a = new DateTime();
            string localDate = a.Day + "-" + a.Month + "-" +a.Year;
    

    And if you just want to edit current Date you got:

            string input = "25/5/2017"; //Get your input how you want
            string[] a = input.Split('/');
            string output = a[0] + "-" + a[1] + "-" + a[2];