您的位置:首页 > 产品设计 > UI/UE

DateValue

2019-08-01 04:37 429 查看
原文链接:https://www.geek-share.com/detail/2442397640.html

DateValue(date_str)

Description

Use the DateValue function to convert a date string and returns the result as a Date type. date_str must be a string in the active date format user's current personalization date format.

If the user's Date Format personalization setting is set to DDMMYY (or it is defaulted to this from their browser locale or the system-wide personalization defaults) then the following code returns a Datetime value equal to September 10, 1997.

&DTM = DateValue("10/09/97");
If the user's Date Format personalization setting is set to MMDDYY (or it is defaulted to this from their browser locale or the system-wide personalization defaults) then the same function call returns a value equal to October 9, 1997.

Using this Function in Fields Without a Default Century Setting

This function may derive the wrong century setting if passed a 2-character year and DateValue is executing in a PeopleCode event not associated with a field that has a default century setting.

For example, assume that TEST_DATE is a date field with a default century setting of 10. TEST_FIELD is a field with no default century setting. If the following PeopleCode program is executing in TEST_FIELD, the date will be calculated incorrectly:

TEST_DATE = DateValue("10/13/11");
Though TEST_DATE has a century setting, it isn’t used because the PeopleCode fired in TEST_FIELD. Instead, DateValue uses the 50/50 rule and calculates the year to be 2011 (instead of 1911).

Returns

Returns a Date value

转载于:https://www.cnblogs.com/GoDevil/archive/2009/01/08/1371891.html

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: