Bug 30851

Summary: Incorrect (Swedish) date format since version 3.4.0
Product: [Mono] Class Libraries Reporter: roon
Component: mscorlibAssignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: masafa, mono-bugs+mono, mono-bugs+runtime
Priority: ---    
Version: 3.4.0   
Target Milestone: Untriaged   
Hardware: Other   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

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