首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >DateTime.Now.Tostring() -奇怪的结果

DateTime.Now.Tostring() -奇怪的结果
EN

Stack Overflow用户
提问于 2013-06-05 04:13:37
回答 1查看 1.1K关注 0票数 2

我在Raspberry Pi上使用Mono (运行Raspbmc)。大多数事情(令人惊讶!)简单地工作,但是有一段代码表现得很奇怪。

使用csharp外壳“C#”,我得到了如下结果(对于编译后的副本,结果是相同的):

代码语言:javascript
复制
csharp> DateTime.Now.ToString();
"00/735023/0001 23:05:56"

csharp> DateTime.Now.ToString("dd"); //get day numeral
"735023"

csharp> DateTime.Now.ToString("MMMM"); //get month name
System.ArgumentOutOfRangeException: Argument is out of range.
  at System.Globalization.DateTimeFormatInfo.GetMonthName (Int32 month) 
  [...]

...However,访问单独的属性是有效的:

代码语言:javascript
复制
csharp> DateTime.Now.Day.ToString();
"4"

csharp> DateTime.Now.Month.ToString();
"6"

csharp> DateTime.Now.Year.ToString();
"2013"

你知道发生了什么吗,或者至少我应该在哪里提交一个bug?

FWIW:这就是我正在运行的

代码语言:javascript
复制
pi@raspbmc:~$ mono -V
Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-5)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  armel,vfp
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            Included Boehm (with typed GC and Parallel Mark)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-06-05 04:29:08

有相关的bug报告:https://bugzilla.xamarin.com/show_bug.cgi?id=7938。原因:使用hardfp而不是softfp浮点ABI,这与Mono 2.10不兼容。Mono中有一些补丁来支持hardfp,但还没有主流的补丁。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16926634

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档