XNA Creators Club Online
Page 1 of 1 (6 items)
Sort Posts: Previous Next

DateTime formatting error on XNA for Zune

Last post 05-12-2008 5:21 PM by ColossalRobot. 5 replies.
  • 05-10-2008 8:31 PM

    DateTime formatting error on XNA for Zune

    This may be by design but I think I may have found a bug on the Zune version of XNA.

    For example:

    DateTime.Now.ToString("hh:mm:ss:ff");

    On windows the results in "12:34:10:45" on the Zune it is "12:34:10:00" where "ff" is always 0. I'm guessing it's a precision limitation issue with the Zune hardware but I'm not sure so I thought I'd post it.

  • 05-11-2008 7:24 PM In reply to

    Re: DateTime formatting error on XNA for Zune

    Post it to http://connect.microsoft.com otherwise you can't rely on anyone seeing it.

    The ZBuffer News and information for XNA
    Please read the forum FAQs - Bug reporting
  • 05-12-2008 1:25 PM In reply to

    Re: DateTime formatting error on XNA for Zune

    Is your problem that DateTime.Now is never returning fractional second information, or that when you format a DateTime containing fractional second information, the returned string doesn't include that data?

    These would be different problems: one is in the DateTime.Now clock measurement, the other in the ToString formatting code.
    XNA Framework Developer - blog - homepage
  • 05-12-2008 4:25 PM In reply to

    Re: DateTime formatting error on XNA for Zune

    The DateTime.Now clock measurement seems to be off.  I was trying to use the DateTime.Now.Ticks to do some basic profiling measurements and I've noticed that the number returned always has a zero in the last 7 digits.

    Are there any other ways to get the current time?
  • 05-12-2008 4:39 PM In reply to

    Re: DateTime formatting error on XNA for Zune

    DateTime.Now is not guaranteed to have any particular precision, so you should not use it for performance measuring.

    For accurate measurements of small time deltas, you want System.Diagnostics.Stopwatch.
    XNA Framework Developer - blog - homepage
  • 05-12-2008 5:21 PM In reply to

    Re: DateTime formatting error on XNA for Zune

    Thanks, that works much better.
Page 1 of 1 (6 items) Previous Next