locked
Convert any Date Format into dd/MM/yyyy RRS feed

  • Question

  • My Application culture changes according. If a user access application in chines the application culture changes into chines and user will enter the date into chines culture... same happen according to different cultures like (ja-JP, zh-HK, zh_TW, ...)

    I want to convert all date format into dd/MM/yyyy

    Any Code Sample

    Thanks.


    Abdul Jabbar

    Wednesday, September 10, 2014 7:51 AM

Answers

  • Are you talking about ToString() like this:

    string s = DateTimeOffset.Now.ToString("dd/MM/yyyy");

    • Marked as answer by Caillen Tuesday, September 16, 2014 9:32 AM
    Wednesday, September 10, 2014 8:02 AM
  • You can use DateTime.ParseExact(). 

    Refer to the MSDN for more info.


    Ram.

    • Marked as answer by Caillen Tuesday, September 16, 2014 9:32 AM
    Wednesday, September 10, 2014 8:26 AM

All replies

  • Are you talking about ToString() like this:

    string s = DateTimeOffset.Now.ToString("dd/MM/yyyy");

    • Marked as answer by Caillen Tuesday, September 16, 2014 9:32 AM
    Wednesday, September 10, 2014 8:02 AM
  • You can use DateTime.ParseExact(). 

    Refer to the MSDN for more info.


    Ram.

    • Marked as answer by Caillen Tuesday, September 16, 2014 9:32 AM
    Wednesday, September 10, 2014 8:26 AM