/etc/locatime
C#/Mono アプリケーションでファイルを 1 つに置き換えることでタイム ゾーンを変更していますが/usr/share/zoneinfo
、ほぼ機能します。
これが私のコードです:
Console.WriteLine("a) Current Time zone: {0}", TimeZoneInfo.Local.StandardName);
Console.WriteLine("a) Now: {0}", DateTime.Now);
// Changing /etc/locatime from CET to PST ...
TimeZoneInfo.ClearCachedData();
Console.WriteLine("b) Current Time zone: {0}", TimeZoneInfo.Local.StandardName);
Console.WriteLine("b) Now: {0}", DateTime.Now);
そして、ここに出力があります:
a) Current Time zone: CET
a) Now: 10/20/2012 2:00:26 PM
b) Current Time zone: PST
b) Now: 10/20/2012 2:00:26 PM
ご覧のとおり、タイム ゾーンは正しいですがDateTime.Now
、ローカル タイムを返すはずの が機能せず、同じ値を 2 回返します。
私が使用しているモノのバージョンは次のとおりです。
user@ubuntu:~$ mono -V
Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.2)
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)
誰かがこの問題について考えを持っていますか?