Bug 30851 - Incorrect (Swedish) date format since version 3.4.0
Summary: Incorrect (Swedish) date format since version 3.4.0
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 3.4.0
Hardware: Other Linux
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2015-06-05 12:38 UTC by roon
Modified: 2015-06-16 11:57 UTC (History)
3 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 GitHub or Developer Community 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 FIXED

Description roon 2015-06-05 12:38:57 UTC
Running HelloWorldMMM.cs 
using System; 

namespace HelloWorld 
{ 
        class MainClass 
        { 
                public static void Main (string[] args) 
                { 
                        Console.WriteLine ("Hello World, below is DateTime.Now.ToString MMM, MMMM, ddd and dddd"); 
                        Console.WriteLine (DateTime.Now.ToString("MMM")); 
                        Console.WriteLine (DateTime.Now.ToString("MMMM")); 
                        Console.WriteLine (DateTime.Now.ToString("ddd")); 
                        Console.WriteLine (DateTime.Now.ToString("dddd")); 
                } 
        } 
} 

with version 3.2.8 on CentOS, LANG=sv_SE.UTF-8 and on Swedish Windows 7 and 8.1
Hello World, below is DateTime.Now.ToString MMM, MMMM, ddd and dddd
jun
juni
fr
fredag

Running with version 3.4.0 and later
Hello World, below is DateTime.Now.ToString MMM, MMMM, ddd and dddd
Jun
Juni
Fre
fredag
Comment 1 Marek Safar 2015-06-08 05:06:29 UTC
Using following test I get same result on .net and Mono 4.0

using System;

namespace HelloWorld
{
	class MainClass
	{
		public static void Main (string[] args)
		{ 
			System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo ("sv-SE");

			Console.WriteLine ("Hello World, below is DateTime.Now.ToString MMM, MMMM, ddd and dddd"); 
			Console.WriteLine (DateTime.Now.ToString ("MMM")); 
			Console.WriteLine (DateTime.Now.ToString ("MMMM")); 
			Console.WriteLine (DateTime.Now.ToString ("ddd")); 
			Console.WriteLine (DateTime.Now.ToString ("dddd")); 
		}
	}
}

Hello World, below is DateTime.Now.ToString MMM, MMMM, ddd and dddd
Jun
Juni
Mån
måndag
Comment 2 roon 2015-06-08 12:11:56 UTC
Resolved?
How are you running if with .net?

C:\Users\Roger>ver

Microsoft Windows [Version 6.1.7601]

C:\Users\Roger>HelloWorldMMM.exe
Hello World, below is DateTime.Now.ToString MMM, MMMM, ddd and dddd
jun
juni
må
måndag


[roger@CentOS ~]$ mono -V
Mono JIT compiler version 3.2.8 (tarball Sat Jun  6 21:55:45 CEST 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen
[roger@CentOS ~]$ export LANG=sv_SE.UTF-8
[roger@CentOS ~]$ mono HelloWorldMMM.exe
Hello World, below is DateTime.Now.ToString MMM, MMMM, ddd and dddd
jun
juni
mån
måndag
[roger@CentOS ~]$ echo Date formats: `date "+%b when b, %B when B, %a when a and %A when A"`
Date formats: jun when b, juni when B, mån when a and måndag when A
Comment 3 Marek Safar 2015-06-09 05:55:04 UTC
I don't have obsolete 3.2.8 version to test but newer versions have same values as .net with capital letter, is the capital letter the issue or something else?
Comment 4 roon 2015-06-09 11:56:05 UTC
I've build 3.2.8 from http://download.mono-project.com/sources/mono/mono-3.8.0.tar.bz2

Yes, the capital letter is the issue.
When running Cumulus MX (http://sandaysoft.com/forum/index.php) with 3.2.8, the monthly file is jun15.txt but after upgrade to 4.0.1 I get Jun15.txt.

How do you run HelloWorldMMM.ex in .net to get the Capital?
As you can see I get lower case on windows 7.
Comment 5 Marek Safar 2015-06-16 11:57:37 UTC
Fixed in master