Bug 2838 - "d" format specifier returns incorrect results
Summary: "d" format specifier returns incorrect results
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-01-10 16:43 UTC by Yiannis
Modified: 2012-01-11 11:24 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Yiannis 2012-01-10 16:43:38 UTC
If today date is Jan 10 2012 then 
DateTime.Now.ToString("d")  returns: "1/10/2012" .

It should return "10"  (the day of month)

This happens on any given date.
Comment 1 Duncan Mak 2012-01-11 11:24:03 UTC
This is NOTABUG, We give the same output as MS does on Windows.

You can read more about the DateTime format specifiers here: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx#dSpecifier

In particular, "If the "d" format specifier is used without other custom format specifiers, it is interpreted as the "d" standard date and time format specifier."

Here's the output of a testing program:

using System;

class X {
    static void Main () {
        Console.WriteLine ("'d': "    + DateTime.Now.ToString ("d"));
        Console.WriteLine ("'d, M': " + DateTime.Now.ToString ("d, M"));
    }
}

Specifier: 'd': 1/11/2012
Specifier: 'd, M': 11, 1