Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTime.ToString() with custom formats is outputting wrong data #855

Closed
josesimoes opened this issue Oct 11, 2021 · 0 comments · Fixed by nanoframework/CoreLibrary#159
Closed

Comments

@josesimoes
Copy link
Member

Details about Problem

nanoFramework area: (mscorlib)

Description

Output of DateTime.ToString() with custom formats is wrong on some formats.

Detailed repro steps so we can see the same problem

When reworking Unit Test DateTime_ToStringTest7() got this:

Test DateTime is: 02/28/2430 22:26:20
DateTime.ToString(String) using Custom Formats and Verifying
Testing custom format: 'h:mm:ss.ff t'
Output was '10:26:20.112200 P'

Other suggested things

Expected behavior

  1. Need to revisit the code that's outputting DateTime.ToString().
  2. Unit Tests for DateTime.ToString() need to be improved to perform actual and detailed check of the output, instead of just relying on an output string with any content (currently are checking for output length only).

Sample Project

Screenshot

Additional context

I've made an effort to fix the bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants