createdon领域日期时间格式 [英] createdon field date-time format

查看:147
本文介绍了createdon领域日期时间格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译如下COE总是得到相同的错误,令人沮丧。我想一个createdon领域比作当前日期。我试过几个日期格式,但还是老样子没有工作...

Compiling the following coe always get the same frustrating mistake. I'm trying to compare a "createdon" field to a the present date. I've tried several date format but stil not working...

错误的细节:为23/05/2012的日期时间格式为14点01分55秒无效的

Error detail : "The date-time format for 23/05/2012 14:01:55 is invalid"

代码段:

DateTime d = DateTime.Now;
                String.Format("{0:dd/MM/YYYY HH:mm:ss}", d);

                FetchExpression fetch = new FetchExpression(@"
                    <fetch distinct='false' mapping='logical'>
                      <entity name='" + context.PrimaryEntityName + "'><filter type='and'><condition attribute='createdon' value='" + d + "' operator='ne'></condition></filter><link-entity name='new_contrats' alias='nombreligne' from='new_contratsid' to='new_contratsid'><filter type='and'><condition attribute='new_contratsid' value='" + contrats.Id + "' operator='eq'></condition></filter></link-entity></entity></fetch>");



任何帮助将是巨大的!

Any help would be great !

推荐答案

博客张贴在这里可能的帮助。基本上,UTC格式但始发用户的本地偏移可实现在数据库中的潜在价值。

My blog posting here might help. Basically, UTC format but originating user's local offset may effect the underlying value in the database.

这篇关于createdon领域日期时间格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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