[Mono-list] Is DateTime.Now correct ?

yoros@wanadoo.es yoros@wanadoo.es
Mon, 19 May 2003 22:21:47 +0200


On Mon, May 19, 2003 at 03:07:06PM +0100, Philip Van Hoof wrote:
> [root@pluisje freax]# mcs Test.cs
> ???Compilation succeeded
> [root@pluisje freax]# date
> Thu Jan  1 00:02:18 CET 1970
> [root@pluisje freax]# date -s "1970-01-01"
> Thu Jan  1 00:00:00 CET 1970
> [root@pluisje freax]# date
> Thu Jan  1 00:00:01 CET 1970
> [root@pluisje freax]# mono Test.exe
> ???e: 12/31/1969 23:00:06
> 621355932065124730
> [root@pluisje freax]# cat Test.cs
> using System;
> using System.IO;
> using System.Runtime.InteropServices;
> public class Test {
>   public static int Main (string[] args)
>   {
>     DateTime e = DateTime.Now;
>     Console.WriteLine("e: {0}", e.ToString());
>     Console.WriteLine("{0}", e.Ticks);
>     return -1;
>   }
> }
> [root@pluisje freax]#
> 
> It looks like DateTime.Now is 60 minutes wrong .. :-\

Please, check if your hwclock is with the same time that the system one.
"date" shows system time, "hwclock" shows the internal clock time. They
could be different because of the timezone configuration... I think.

See you,

    Pedro

-- 
Pedro Martínez Juliá
\  yoros@terra.es
)|    yoros@wanadoo.es
/        http://yoros.cjb.net
Socio HispaLinux #311
Usuario Linux #275438 - http://counter.li.org
GnuPG public information:  pub  1024D/74F1D3AC
Key fingerprint = 8431 7B47 D2B4 5A46 5F8E  534F 588B E285 74F1 D3AC