COleDateTime :: ParseDateTime不适用于塞尔维亚语西里尔语格式 [英] COleDateTime::ParseDateTime does not work with Serbian cyrillic format

查看:184
本文介绍了COleDateTime :: ParseDateTime不适用于塞尔维亚语西里尔语格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码:

COleDateTime dt(2018,7,5,0,0,0);

CString strDate = dt.Format (VAR_DATEVALUEONLY);
$
bool bSuccess = dt.ParseDateTime(strDate);

COleDateTime dt(2018,7,5,0,0,0);
CString strDate = dt.Format(VAR_DATEVALUEONLY);
bool bSuccess = dt.ParseDateTime(strDate);

导致"dt​​"如果系统日期格式设置为塞尔维亚语(西里尔语,塞尔维亚语),则无效且bSuccess为false。

results in "dt" being invalid and bSuccess being false if the system date format is set to Serbian (Cyrillic, Serbia).

我认为我做错了什么。我通过指定LCID并使用LOCALE_NOUSEROVERRIDE作为标志测试了一些不同的东西,没有任何变化。 strDate是"5.7.2018"。如果删除最后一个"。"有用。但这不能是
正确的解决方案。

对我来说,似乎COleDateTime :: ParseDateTime无法正常进行此格式设置。

I don't think I am doing anything wrong. I tested a few different things by specifying the LCID and using LOCALE_NOUSEROVERRIDE as flag, with no changes. strDate is "5.7.2018." and if remove the last "." it works. But that can't be the correct solution.
To me it seems like COleDateTime::ParseDateTime is not working correctly for this format setting.

推荐答案

您好,

您使用哪个VS版本?

如果是最新版本,那我认为这是一个错误。您可以在VS中报告(菜单帮助 - >发送反馈 - >报告问题)。

If it's the latest version, then I think it is a bug. You can report it in your VS (menu Help -> Send Feedback -> Report a problem).

问候,Guido


这篇关于COleDateTime :: ParseDateTime不适用于塞尔维亚语西里尔语格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆