System variables %%Date %%Time

Several scripts
Post Reply
User avatar
chand
Nouveau
Nouveau
Posts: 3
Joined: 10 Jun 2009 12:00

System variables %%Date %%Time

Post by chand » 09 Sep 2009 7:44

Hi,

I know we can do this:

AutoEdit Assignment
%%A=%%CALCDATE %%DATE -5
%%A=%%SUBSTR %%A 3 4

Command Line:
<program> %%A

I would like do a Time calculation, and could not find the equivalent codes or example, such as:

AutoEdit Assignment
%%A=%%CALCTIME %%TIME +5 (in minutes)
%%A=%%SUBSTR %%A 1 5

Command Line:
<program> %%A (the expected output time, ie. 21:05)

Could anyone please help me what is the best way to get the time. Many thanks.

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 09 Sep 2009 3:03

wich database ?
because in sybase i have another way to do it by script
as you can calculate time base on DATETIME using the following:

SQL -U<emuser> -P<pass>
select getdate()
go

and using the dateadd function :
SQL -U<emuser> -P<pass>
select dateadd(mi,-30,getdate())
go

result :
1> select getdate()
2> go

--------------------------
Sep 9 2009 3:00PM

(1 row affected)
1>

1> select dateadd(mi,-30,getdate())
2> go

--------------------------
Sep 9 2009 2:32PM

(1 row affected)
1>

mi representing minutes


regards
philmalmaison




regards
philmalmaison

Post Reply