suhas-mahajan
2nd October 2004, 11:58
Hi All,
I would like to compare form time of domain tctmhs to table stored time, which is stored in seconds, How to achieve it? Because my endusers can not enter time in seconds? Is there any short-cut avoiding calculations?
Thanks in advance.
Regards,
-Suhas
NPRao
5th October 2004, 03:34
Suhas,
Check the available functions in the dll - tcccpdll3095 - Date & Time conversion functions
function extern domain tcbool tcccp.dll3095.check.for.date.in.year(
domain tcdate i.date,
domain tcccp.yrno i.year,
domain tctimz in.timz mb )
Expl : The function checks if the date falls in the defined
year
post : If the date is not in the year false is returned
Input : i.date -> Date to be checked if it falls in the year
i.year -> Year
Output : False -> Date doesn't fall in the defined year
True -> Date is in the defined year
function extern domain tcbool tcccp.dll3095.check.for.date.in.year.non.utc(
domain tcccp.date i.date,
domain tcccp.yrno i.year )
Expl : The function checks if the date falls in the defined
year
post : If the date is not in the year false is returned
Input : i.date -> Non UTC Date to be checked if it falls in the year
i.year -> Year
Output : False -> Date doesn't fall in the defined year
True -> Date is in the defined year
function extern long tcccp.dll3095.gap.in.sec(
domain tctmhs i.time1,
domain tctmhs i.time2 )
Expl : This DLL is used to give the difference between a given
start and a end time
Input : i.time1 -> First Input Time in Time format (long)
i.time2 -> Sec. Input Time in Time format (long)
Output : range.time -> Difference as seconds
function extern long tcccp.dll3095.gap.in.sec1(
domain tcthms i.time1,
domain tcthms i.time2 )
function extern domain tcbool tcccp.dll3095.local.to.utc(
domain tcccp.date i.local.date,
domain tctmhs i.local.time,
domain tczone i.time.zone.id,
ref domain tcdate o.utc.date )
Expl : This DLL is used to convert utc date to local format
Input : i.local.date -> input date
i.local.time -> input time in sec
i.time.zone ->
Output : o.utc.date -> Converted utc date
function extern tcccp.dll3095.reset.timezone()
Expl: In case a utc to local is done, and no local to utc this
funciton must be called
function extern domain tcthms tcccp.dll3095.seconds.to.thms(
long i.seconds )
function extern domain tctmhs tcccp.dll3095.seconds.to.time(
long i.seconds )
Expl: Convert seconds to time format.
Pre: -
Post: -
Input: i.seconds - number of seconds.
Output: -
Return: time
function extern domain tcccp.capp tcccp.dll3095.subtract.time(
domain tctmhs i.time1,
domain tctmhs i.time2 )
Expl : This DLL is used to give the difference between a given
start and a end time
Input : i.time1 -> First Input Time in Time format (long)
i.time2 -> Sec. Input Time in Time format (long)
Output : range.time -> Difference as capacity , 30 sec = 0.5
function extern long tcccp.dll3095.thms.to.seconds(
domain tcthms i.time )
function extern domain tctmhs tcccp.dll3095.thms.to.tmhs(
domain tcthms i.time )
function extern long tcccp.dll3095.time.to.seconds(
domain tctmhs i.time )
Expl: Convert time to seconds
Pre: -
Post: -
Input: i.time - time
Output: -
Return: seconds
function extern domain tcthms tcccp.dll3095.tmhs.to.thms(
domain tctmhs i.time )
function extern domain tcbool tcccp.dll3095.utc.to.local(
domain tcdate i.utc.date,
domain tczone i.time.zone.id,
ref domain tcccp.date o.local.date,
ref long o.local.time )
Expl : This DLL is used to convert utc date to local format
Input : i.utc.date -> Input date in utc
i.tzid -> Input time zone , If its empty the user time
zone is used
Output : o.local.date -> Converted Output date
o.local.time -> Converted output time
--------------------------------------------------------------------------------
Used DLL's
--------------------------------------------------------------------------------
Used DLL = otcemmdll1006
Used DLL = ottstp_stddll
--------------------------------------------------------------------------------
DLL Hints
--------------------------------------------------------------------------------
function __initialize.process (Hint: Located in DLL: ottstp_stddll)
function date.to.utc (Hint: Located in DLL: ottstp_stddll)
function date.to.date (Hint: Located in DLL: ottstp_stddll)
function tcemm.dll1006.get.details.of.time.zone (Hint: Located in DLL: otcemmdll
suhas-mahajan
6th October 2004, 07:10
Thanks for the response, Sir.
It seems, out of following functions -
function extern domain tctmhs tcccp.dll3095.thms.to.tmhs(
domain tcthms i.time )
above function may solve my problem. But I think tcccpdll3095 dll is not available in BaaN IV C4.
Is there any alternate?
Regards,
-Suhas
wiggum
6th October 2004, 12:51
You can convert time from HHMMSS into seconds in one line:
seconds = time / 10000 * 3600 + time / 100 \ 100 * 60 + time \ 100
NPRao
6th October 2004, 21:25
Suhas,
here is the function code -
function extern domain tctmhs tcccp.dll3095.thms.to.tmhs(domain tcthms i.time)
{
DllUsage
Expl:
Pre:
Post:
Input:
Output:
Return:
EndDllUsage
domain tctmhs converted.time
converted.time = i.time / 100
return (converted.time)
}
sdvries
7th October 2004, 11:09
You can convert time from HHMMSS into seconds in one line:
seconds = time / 10000 * 3600 + time / 100 \ 100 * 60 + time \ 100
As the maintainer of the tcccp.dll3095 code I cannot leave behind and post also a solution :).
The tctmhs does not contain seconds, it is in the HHMM format and the conversion from this format to seconds is:
( ( i.time / 100 ) * 3600 ) + ( ( i.time \ 100 ) * 60 )
regards,
Sicco
suhas-mahajan
8th October 2004, 07:41
Sicco,
You are right, tctmhs does not contain seconds for that I have choose tctime domain, time being I have delivered the session. But I want to use tctmhs domain so that end users will enter time in HHMM format.
Also your code couldn't solve my problem. I want to use it in the query.
Regards,
-Suhas