ddwrt:FormatDate with different FormatFlags
2010-09-23 23:25
357 查看
ddwrt:FormatDate with different FormatFlags
Posted by PANVEGA on December 8, 2008I needed to use the ddwrt functions in my content query web part. Using the FormatFlags you can easily transform the format you wish.
Add the following namespace attribute to the root xsl:stylesheet element
xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
This provided more examples of the FormatDateTime formatting codes (like YYYYMMDDThh:mm):
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
Here’s a list of languages with their LCID:
http://support.microsoft.com/default.aspx?id=221435
Language packs for Office SharePoint Server 2007 are not bundled into multilingual installation packages. You must install a specific language pack for each language that you want to support. Also, language packs must be installed on each of your front-end Web servers to ensure that each Web server can render content in the specified language.
The following table lists the language packs that are available for Office SharePoint Server 2007.
German | Germany | 1031 |
English | United States | 1033 |
Japanese | Japan | 1041 |
ddwrt:FormatDate(string(@EventDate), 1033, 5) => MM/DD/YYYY
ddwrt:FormatDate(string(@EventDate), 1033, 1) => MM/DD/YYYY HH:MM AM/PM
Note that in the FormatDate function I used 2 hard coded values – 3081 which is the LCID for German (so the date will be formatted to Germany date format) and 5 or 1 are the different FormatFlags which specifies the what do I want to display – date, time, date and time ect.
Sharepoint works with dates in the ISO8601 format: yyyy-mm-ddThh:mm:ssZ so when I delve into CAML I can write stuff like this:
<Query>
<Where>
<Gt>
<FieldRef Name=”EventDate” />
<Value Type=”DateTime”>2005-5-27T00:00:00Z</Value>
</Gt>
</Where>
</Query>
More links:
http://msdn.microsoft.com/en-us/library/aa505323.aspx#officesharepointddwrt_formatdate
相关文章推荐
- iOS打开旧项目报错:Typedef redefinition with different types (‘SCNetworkConnectionFlags’ (aka ‘unsigned int
- Compare two different format date string
- ddwrt:FormatDate使用详解
- [BTS] RFCTYPE RFCTYPE_DATE with length 8 and decimals 0 to XML format
- The Different Format of Date in English
- json换回的数据带时间格式 处理办法.toJSONStringWithDateFormat
- [BTS] RFCTYPE RFCTYPE_DATE with length 8 and decimals 0 to XML format.
- Simple trick to convert Date format with timezone in Java!
- cannot find the flags to link with Boost date_time 错误修复
- 解决ea【syui 中显示Date类型数据为[object Object]】两种方式:手动实现+JSON.toJSONStringWithDateFormat(obj,"farmat")
- Project configuration is not up-to-date with pom.xml.Run project configuration update
- simpledateformat 字符串转时间
- javascript Date format(js日期格式化)
- DateFormat 的多线程问题
- SimpleDateFormat线程不安全及解决方式
- SimpleDateFormat的pattern模式YYYYMMDDHHmmSS
- mysql的日期和时间函数–date_format
- SimpleDateFormat使用详解
- org.hibernate.NonUniqueObjectException: A different object with the same identifier value was alread
- 【mysql】Date和String的互相转换(DATE_FORMAT & STR_TO_DATE)