注册 登录
编程论坛 PowerBuilder

如何在时间time上减几小时

jump2003 发布于 2006-07-27 08:33, 829 次点击
我想在时间time上减几小时,该怎么写啊?
2 回复
#2
LouisXIV2006-07-27 08:37

time t

t = relativeTime( 19:39:50, 10 ) //t = 19:40:00

#3
潇洒老乌龟2006-07-29 14:40

RelativeTime PowerScript function
Description

Obtains a time that occurs a specified number of seconds after or before another time within a 24-hour period.

Syntax

RelativeTime ( time, n )

Argument Description
time A value of type time
n A long number of seconds
Return value

Time. Returns the time that occurs n seconds after time if n is greater than 0. Returns the time that occurs n seconds before time if n is less than 0. The maximum return value is 23:59:59. If any argument's value is NULL, RelativeTime returns NULL.

This statement returns 19:01:41:

RelativeTime(19:01:31, 10)

This statement returns 19:01:21:

RelativeTime(19:01:31, - 10)

1