locked
How can i change the format of DateTime (of Last Check-in column) in Source Control Explorer ? RRS feed

  • Question

  • User1025658462 posted

    hi there . 

    i want to change the format of Date (and if is possible change the Date culture to Persian Date [Jalali] ) in the Source Contorl Explorer of VS 2010 & 2012 . is it possible and if yes how can i do it ?

    is it related to Agile Template ?

    thanks in Advanced

    Tuesday, June 4, 2013 3:53 PM

All replies

  • User-1635195291 posted

    Hi mbs220,

    You can try the following code:

    Just use the ToDateTime method on the PersianCalendar class:

    PersianCalendar p = new PersianCalendar();
    DateTime now = DateTime.Now;
    DateTime dateT = p.ToDateTime(now.Year, now.Month, now.Day, 0, 0, 0, 0);

    Then to get your string in that format, just do:

    string str = dateT.ToShortDateString();

    or else can try :

    PersianCalendar p = new System.Globalization.PersianCalendar();
    DateTime today = DateTime.Today;
    DateTime pDate = new DateTime(p.GetYear(today), p.GetMonth(today), p.GetDayOfMonth(today), p);
    DateTime d2 = DateTime.Parse(textBox9.Text);
    // THIS NEEDS TO BE EXPLAINED
    textBox10.Text = (d2 - pDate).ToString().Replace(".00:00:00","");

    or else follow the link below:

    http://stackoverflow.com/questions/6807234/how-to-print-datetime-in-persian-format-in-c-sharp

    http://stackoverflow.com/questions/1364127/how-can-convert-persian-datettime-to-datetime-with-c

    Hope above mention solutioned helped you.

    Thanks,

    Jatin

    Please "MARK AS ANSWER" if found helpful.



    Tuesday, June 4, 2013 8:42 PM
  • User1025658462 posted

    a bad-understood Exception thrown !!! Cool

    i do not want to code in my Project (ASP of Cocsonle or Win App or etc.) ,

    i want to customize the Source control Explorer 's Column (date time) .

    Not code a persian calender or Persian DateTime !!!!!! in my page or Application .

    i want to change format of date time in TFS Source Control Explorer  

    as shown in image (it's Add-on of Visual Studio)

    i hope be clear?

    thanks

    Wednesday, June 5, 2013 3:13 AM
  • User1025658462 posted

    a bad-understood Exception thrown !!! Cool

    i do not want to code in my Project (ASP of Console or Win App or etc.) ,

    i want to customize the Source control Explorer 's Column (date time) .

    Not code a persian calender or Persian DateTime !!!!!! in my page or Application .

    i want to change format of date time in TFS Source Control Explorer  

    as shown in image (it's Add-on of Visual Studio)

    i hope be clear?

    thanks

    Wednesday, June 5, 2013 3:13 AM