[Mono-dev] DateTime.Now gives a wrong time

k0l0b0k.void at gmail.com k0l0b0k.void at gmail.com
Wed Oct 12 07:42:12 EDT 2011


Hello. I'm using Mono 2.6.7 (distro) on Debian squeezy, fully up to date, in 
my little enterprise environment.
Some days ago, I've noticed a strangest behavior - all my services, based on 
mono shows a wrong time on calling DateTime.Now (with a difference of 1 hour 
ago). Any other services (php and RoR-based) gives normal current time.

I've created simple test, and build it directly on server:

using System;

class Test
{
        public static void Main()
        {
                Console.WriteLine("{0}", DateTime.Now);
        }
}


and got next output:
user at server:~# ./test.exe 
10/12/2011 13:09:07
user at server:~# date
Wed Oct 12 14:09:10 FET 2011

i.e. local time handles correctly by all software except mono (local timezone 
is set correctly). May be it is Debian-specific (coz mono does not update 
recently, and some days ago all was fine)? Should I post it to Debian 
maintainers?

Thanks in advice, I need to fix it urgently, there are 3 servers with mono-
based services, and the same issue.

server:~# mono -V
Mono JIT compiler version 2.6.7 (Debian 2.6.7-5)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC and Parallel Mark)
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none


More information about the Mono-devel-list mailing list