-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
调用 new CSRedis.CSRedisClient(null, redisConnect);方法后,DateTime.Now默认格式发生了改变。 #31
Comments
new CSRedis.CSRedisClient(null, redisConnect); 没有做区域化操作 |
还有这个操作,没深入内部看,不确定原作者的逻辑。目前使用没有被这块影响。 可以先在 new CSRedis.CSRedisClient(null, redisConnect); 后,再次设置 CultureInfo.DefaultThreadCurrentCulture 解决当前问题,待查明原因后再做优化。 |
我就是被坑了的。系统中有部分位置涉及到获取当前时间, 然后将时间ToString(),拼接成sql的条件。就导致筛选出的结果有问题。作者两句注释: |
确实比较坑,我深入了解一下。 |
额外一个建议,sql拼接最好不要用 DateTime.Now.ToString(),不安全。 我这边拼接 sql 基本都传 ToString("yyyy-MM-dd HH:mm:ss") |
从注释看来这行代码还真不能去掉。 |
在 new CSRedis.CSRedisClient之前,DateTime.Now的格式为yyyy/MM/dd,调用之后MM/dd/yyyy。如图所示:
The text was updated successfully, but these errors were encountered: