Skip to content

Instantly share code, notes, and snippets.

@directhex
Created December 11, 2014 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save directhex/f6fb44c6274f88ff5d51 to your computer and use it in GitHub Desktop.
Save directhex/f6fb44c6274f88ff5d51 to your computer and use it in GitHub Desktop.
[mono-20141210094159]directhex@marceline:/tmp$ mono --version
Mono JIT compiler version 3.99.0 (tarball Wed Dec 10 17:02:24 UTC 2014)
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
[mono-20141210094159]directhex@marceline:/tmp$ mono test.exe
en_US w/ componentmodel: 12/31/2008 11:59 pm
en_US direct: 12/31/2008 11:59:58 PM
en_GB w/ componentmodel: 31/12/2008 23:59
en_GB direct: 31/12/2008 23:59:58
directhex@marceline:/tmp$ mono --version
Mono JIT compiler version 3.10.0 (tarball Wed Nov 5 12:50:04 UTC 2014)
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
directhex@marceline:/tmp$ mono test.exe
en_US w/ componentmodel: 12/31/2008 11:59 PM
en_US direct: 12/31/2008 11:59:58 PM
en_GB w/ componentmodel: 31/12/2008 23:59
en_GB direct: 31/12/2008 23:59:58
using System;
using System.Globalization;
using System.ComponentModel;
class Test{
static void Main(){
DateTimeConverter converter = new DateTimeConverter ();
DateTime date = new DateTime(2008, 12, 31, 23, 59, 58, 5);
CultureInfo ci = new CultureInfo("en-US");
Console.WriteLine("en_US w/ componentmodel: {0}",converter.ConvertTo(null, ci, date, typeof(String)));
Console.WriteLine("en_US direct: {0}", date.ToString(ci));
CultureInfo ci2 = new CultureInfo("en-GB");
Console.WriteLine("en_GB w/ componentmodel: {0}",converter.ConvertTo(null, ci2, date, typeof(String)));
Console.WriteLine("en_GB direct: {0}", date.ToString(ci2));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment