关于<%# Eval("createTime"%>的时间格式转换

简介: 出现问题: 在ASP.NET中,前台页面在调用后台数据库时间时,使用<%# Eval("createTime"%>,发现时间显示的是数据库的时间类型"2015/10/29 13:40:01",想要改成"2015-10-29"的时间显示类型。 解决方法: 在<%# Eval("createTime"%>里添加格式样式,修改后如下: <%# Eval("c

出现问题:

在ASP.NET中,前台页面在调用后台数据库时间时,使用<%# Eval("createTime"%>,发现时间显示的是数据库的时间类型"2015/10/29 13:40:01",想要改成"2015-10-29"的时间显示类型。

解决方法:

在<%# Eval("createTime"%>里添加格式样式,修改后如下:

<%# Eval("createTime", "{0:yyyy-MM-dd}")%>

目录
相关文章
|
8月前
|
JavaScript 编译器
模块 &quot;&quot;element-plus&quot;&quot; 没有导出的成员 &quot;ElMessage&quot;。你是想改用 &quot;import ElMessage from &quot;element-plus&quot;&quot; 吗?
模块 &quot;&quot;element-plus&quot;&quot; 没有导出的成员 &quot;ElMessage&quot;。你是想改用 &quot;import ElMessage from &quot;element-plus&quot;&quot; 吗?
226 0
|
前端开发
CSS之选择器(十)&lt;label&gt; 和 &lt;input&gt;
CSS之选择器(十)&lt;label&gt; 和 &lt;input&gt;
CSS之选择器(十)&lt;label&gt; 和 &lt;input&gt;
|
自然语言处理
合同结构化文书解析失败,请联系管理员排查:{&quot;code&quot;:3001,&quot;message&quot;:&quot;File transform error&quot;,&quot;success&quot;:false,&quot;tracerId&quot;:&quot;requestId&quot;}报错处理
在使用自然语言处理自学习平台时,标注任务需要上传标注数据,但是使用doc格式上传文件后开始标注时出现了此提示,此篇文章简单介绍下此问题的处理方式。
611 0
合同结构化文书解析失败,请联系管理员排查:{&quot;code&quot;:3001,&quot;message&quot;:&quot;File transform error&quot;,&quot;success&quot;:false,&quot;tracerId&quot;:&quot;requestId&quot;}报错处理
ng-repeat part2 - How &lt;li ng-repeat=&quot;nameF in Ionames&quot;&gt;{{nameF}}&lt;/li&gt; is parsed
ng-repeat part2 - How &lt;li ng-repeat=&quot;nameF in Ionames&quot;&gt;{{nameF}}&lt;/li&gt; is parsed
ng-repeat part2 - How &lt;li ng-repeat=&quot;nameF in Ionames&quot;&gt;{{nameF}}&lt;/li&gt; is parsed
|
JavaScript 前端开发 Java
var oButtonView1 = oView.byId(&quot;ButtonView1&quot;);
var oButtonView1 = oView.byId(&quot;ButtonView1&quot;);
var oButtonView1 = oView.byId(&quot;ButtonView1&quot;);
OPA 13 - ok(oButton,&quot;find the Create button&quot;);
Created by Wang, Jerry, last modified on Nov 08, 2015
101 0
OPA 13 - ok(oButton,&quot;find the Create button&quot;);
&nbsp; &quot; &amp; &lt; &gt 等html字符转义
常用表: No. 文字表記 10进制 16进制 文字   Comment 001 &quot; &#34; &#x22; """   quotation mark = APL quote 002 &amp; &#38; &#x26; "&"   ampersand 003 &lt; ...
2305 0
|
存储 算法 C++
C++中的字符串操作&lt;cstring&gt;和&lt;string&gt;的区别
目录 目录 参考资料 字符串 cstring和string的区别在哪 string类的实现 注意不要盲目相信以下内容! 不要盲目相信以下内容! 不要盲目相信以下内容! (重要的事情说三遍),虽然以下内容也经过了我的验证,但是我的验证可能有错误的地方,欢迎大家留言告知。
1279 0
&quot;catalog&quot; 与 &quot;category&quot; 的区别
catalog 中文翻译为: 目录; category 中文翻译为: 类别; catalog 是有一定顺序的条目(item)列表,或者是分类系统列表。 还可以用作动词,表示编目,将条目放置到某个目录下。
1549 0