Narendra Singh

Monday, 5 February 2018

Convert string to Date Time Format MM/DD/YYYY HH:MM:SS TT using C#



string date = "12/21/2017 7:46:30 PM";
DateTime dateResult = DateTime.ParseExact(date, "M/d/yyyy h:m:s tt", CultureInfo.CurrentCulture);

Result: {21-12-2017 19:46:30}
Posted by MSCRM at 05:17 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Comments (Atom)

About Me

MSCRM
View my complete profile

Blog Archive

  • ►  2022 (1)
    • ►  May (1)
  • ►  2020 (1)
    • ►  July (1)
  • ►  2019 (11)
    • ►  September (3)
    • ►  August (2)
    • ►  July (2)
    • ►  June (2)
    • ►  May (2)
  • ▼  2018 (12)
    • ►  December (1)
    • ►  October (3)
    • ►  September (1)
    • ►  July (2)
    • ►  May (1)
    • ►  April (1)
    • ►  March (2)
    • ▼  February (1)
      • Convert string to Date Time Format MM/DD/YYYY HH:M...
  • ►  2017 (5)
    • ►  September (2)
    • ►  August (3)
  • ►  2016 (1)
    • ►  August (1)
Simple theme. Powered by Blogger.