locked
Windows store app - getting computer time and comparing RRS feed

  • Question

  • my app uses 

    (DateTime.Now.ToString("h:mm:ss mm/dd/yyyy")

    To get the system time and format it to show like above. The problem is that when "mm" value is always wrong.

    Sometimes it is 45 or 20  but months only go up to 12.  Does anyone know what the problem is?

    Friday, August 30, 2013 2:58 AM

Answers

  • "mm" is minutes. "MM" is months.

    --Rob

    • Marked as answer by kalel111 Friday, August 30, 2013 4:08 AM
    • Unmarked as answer by kalel111 Friday, August 30, 2013 4:09 AM
    • Marked as answer by Anne Jing Monday, September 9, 2013 1:16 AM
    Friday, August 30, 2013 3:26 AM
    Moderator
  • Hello kalel,

    You can replace "mm/dd/yyyy" to "MM/dd/yyyy". Because in your code mm->minute & for Month it is "MM".

    • Marked as answer by Anne Jing Monday, September 9, 2013 1:16 AM
    Saturday, August 31, 2013 4:29 AM

All replies

  • "mm" is minutes. "MM" is months.

    --Rob

    • Marked as answer by kalel111 Friday, August 30, 2013 4:08 AM
    • Unmarked as answer by kalel111 Friday, August 30, 2013 4:09 AM
    • Marked as answer by Anne Jing Monday, September 9, 2013 1:16 AM
    Friday, August 30, 2013 3:26 AM
    Moderator
  • Hello kalel,

    You can replace "mm/dd/yyyy" to "MM/dd/yyyy". Because in your code mm->minute & for Month it is "MM".

    • Marked as answer by Anne Jing Monday, September 9, 2013 1:16 AM
    Saturday, August 31, 2013 4:29 AM