2012年10月22日星期一

Excel’s date string parsing to fix dates & time for SPSS

Excel's date string parsing to fix dates & time for SPSS

The conversion functions convert time intervals from one unit of time to another. Time intervals are stored as the number of seconds in the interval; the conversion functions provide a means for calculating more appropriate units, for example, converting seconds to days.
Each conversion function consists of the CTIME function followed by a period (.), the target time unit, and an argument. The argument can consist of expressions, variable names, or constants. The argument must already be a time interval. 请参阅 主题 Aggregation functions 详细信息。 Time conversions produce noninteger results with a default format of F8.2.
Since time and dates are stored internally as seconds, a function that converts to seconds is not necessary.
CTIME.DAYS. CTIME.DAYS(timevalue)。数值。返回 timevalue 中的天数(包括小数天数),timevalue 可以是秒数、时间表达式或时间格式的变量。
CTIME.HOURS. CTIME.HOURS(timevalue)。数值。返回 timevalue 中的小时数(包括小数小时数),timevalue 可以是秒数、时间表达式或时间格式的变量。
CTIME.MINUTES. CTIME.MINUTES(timevalue)。数值。返回 timevalue 中的分钟数(包括分数分钟数),timevalue 可以是秒数、时间表达式或时间格式的变量。
CTIME.SECONDS. CTIME.SECONDS(timevalue)。数值。返回 timevalue 中的秒数(包括小数秒数),timevalue 可以是数字、时间表达式或时间格式的变量。
Example
DATA LIST FREE (",") 
/StartDate (ADATE12) EndDate (ADATE12)
StartDateTime(DATETIME20) EndDateTime(DATETIME20)
StartTime (TIME10) EndTime (TIME10).
BEGIN DATA
3/01/2003, 4/10/2003
01-MAR-2003 12:00, 02-MAR-2003 12:00
09:30, 10:15
END DATA.
COMPUTE days = CTIME.DAYS(EndDate-StartDate).
COMPUTE hours = CTIME.HOURS(EndDateTime-StartDateTime).
COMPUTE minutes = CTIME.MINUTES(EndTime-StartTime).
• CTIME.DAYS calculates the difference between EndDate and StartDate in days—in this example, 40 days.
• CTIME.HOURS calculates the difference between EndDateTime and StartDateTime in hours—in this example, 24 hours.
• CTIME.MINUTES calculates the difference between EndTime and StartTime in minutes—in this example, 45 minutes.
buy cheap SPSS statistion 21 SPSS 21  pc mac
 It is not a OEM or tryout version.
 We offer worldwide shippment .
 You can pay by paypal.
Full version  cheap SPSS statistion 21 spss 21   at   $54 

没有评论:

发表评论