b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

c:foreach循环map_c语言有没有foreach_c:foreach(15)

电脑杂谈  发布时间:2017-02-17 06:19:41  来源:网络整理

将字符串类型的时间转换为日期类型.

value 用来格式化的时间或日期的字符串

type 指定格式化的是日期还是时间,或者两者都是取值范围:date,time,both

pattern 自定义格式化样式

dateStyle 日期的格式化样式

timeStyle 时间的格式化样式

timeZone 指定使用的时区

var 存储格式化后的结果

scope 指定存储的范围

示例:

<fmt:setLocale value="zh_cn" />

<fmt:parseDate type="date" value="2008-4-5"/>

输出: Sat Apr 05 00:00:00 CST 2008,

这里已经将字符串” 2008-4-5”转换为了日期对象了.转换一定得注意,类似于2008-4-5这样的字符串,type必须为date,类似于12:34:56的字符串,type必须为time类似于2008-4-5 12:34:56这样的字符串,type必须为both还要注意浏览器的语言环境的设置,如果为zh_tw,那么字符串就必须得符合当地的标准,如为2009/12/7 下午 09:24:26就正确转换为日期对象,否则就会报错.

八:<fmt:setTimeZone>

-------------------------------------------------------------------

value 设定时区

var 存储设定的时区

scope 存储的范围

value用来设定时区,可以是EST,CST,MST,PST等,如果有var属性,则将结果存储在所设定的范围之内.在属性范围内的页面都会使用该时区为默认时区.

Java代码

<fmt:setLocale value="zh_cn" />

<fmt:setTimeZone value="EST" />

<fmt:formatDate value="<%=new Date()%>" type="time" timeStyle="full" /><br />

<fmt:formatDate value="<%=new Date()%>" type="time" timeStyle="full" /><br />

<fmt:formatDate value="<%=new Date()%>" type="time" timeStyle="full" /><br />

<fmt:setLocale value="zh_cn" />

<fmt:setTimeZone value="EST" />

<fmt:formatDate value="<%=new Date()%>" type="time" timeStyle="full" /><br />

<fmt:formatDate value="<%=new Date()%>" type="time" timeStyle="full" /><br />

<fmt:formatDate value="<%=new Date()%>" type="time" timeStyle="full" /><br />

输出:

上午09时25分12秒 EST


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-32905-15.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 东昏侯萧宝卷
      东昏侯萧宝卷

      #吴亦凡#

    • 贾卓龙
      贾卓龙

      跑到浙江这些粗制滥造的工厂去

    热点图片
    拼命载入中...