Eddie Monster
25th April 2002, 16:32
Baan stores time in the number of seconds for that day. I have a table I created that stores seconds. Is there a function that converts these seconds back to time? The only function I have seen that deals with time is time.num() which would give me what I already have.

Thanks!

Ravenscross
25th April 2002, 16:34
As far as I know there is no function for this. Even third party report writers require a lot of messing about to get it to work, as anyone trying to write a time based report in Safari will probably remember with great pain.

Eddie Monster
25th April 2002, 16:37
I thought as much. I can write a function, no problem, but it would have been a little easier if one existed.

Thanks!

Safari... bad memories... getting woozie... must... leave... post...

Ravenscross
25th April 2002, 16:43
Was made even worse of Safari by the fact that the MOD() function was bugged. How many times did I see that a transaction occured at xx:6x.....


NIGHTMARE!!!!

mark_h
25th April 2002, 17:34
We would welcome a function like this in the Code and Utilities Forum. A perfect place to post it just in case someone else needs it in the future.

Thanks

Mark

NPRao
28th April 2002, 09:45
Hi Eddie,

I faced this kind of problem recently and made a function which helped me to do that.

I dont know your purpose, but my purpose was for the time stamping and logging, where I had the difference time between the start and end timers in UTC and I got the diff time in seconds and I needed to convert those seconds, into hours, minutes and seconds.

I think we might extend the functionality for days, months and years too.

Let me know if thats the kind of function you are looking for.

Eddie Monster
29th April 2002, 14:16
I was attempting to time-stamp data. I was able to create a work-around, but would still be interested in your idea for future reference.

MariaC
29th April 2002, 16:15
There is a function called tfgld0032 which converts time in seconds to hhmmss and vice versa. Would this help?

jaymukh
29th April 2002, 16:56
I don't have source code and couldn't use bic_info6.1 as I don't know the object name for this.

Please send me the object name and usage info.

Thanks a lot...

Sincerely...

Jay

MariaC
29th April 2002, 17:16
This is a standard Baan include so there will be no object info on it

jaymukh
29th April 2002, 17:19
Please send me the usage info or Parameter for this function.

Thanks a lot...

Sincerely...

Jay

trchandra
29th April 2002, 18:11
Hey Jay,
This is a function, it does not have any object.
To use these functions, you have include this in your script like...
#include "itfgld0032"

The functions are...

1. function long itfgld0032.num.to.time(domain tctime trans.time)
This converts seconds to time in hhmmss
2. function domain tctime itfgld0032.time.to.num(long trans.time)
THis converts time to seconds

good luck!

jaymukh
29th April 2002, 18:13
Thanks a lot...

Sincerely...

Jay

dbinderbr
21st May 2002, 07:49
Hello friends,

Probably you have already solved your problem converting time to num and vice-versa. But, I would like to offer to you a dll designed by myself. I developed some functions to work with "time" in Baan. With my functions you can convert any variable with seconds to selectable output format like "hh:mm:ss" or "hh:mm" or just "hh", and more, there are functions to make calculates with time. Some examples:

long hold.time
string time.1(08)
string time.2(08)
string result(08)

hold.time = time.num()
time.1 = convert.to.time(hold.time, 1)
|# Format 1 returns a "hh:mm:ss" string
|# time.1 may contain "08:34:13" for example
|# You can also do the following:

result = calculate.time(time.1, time.2, "+", 2)
|# the last "2" identifies the input/output format
|# If time.1 = "10:00" and time.2 = "25:00"
|# result will contain "35:00", it´s useful for package like
|# ts, ps, ti, etc.
|# or just use it to do a simple subtraction to get how many
|# hours a task took to be made:

result = calculate.time(time.1, time.2, "-", 2)
|# where, for example, time.1 = "09:00" and time.2 = "07:00"
|# result would contains "02:00"
|# now, you can return the string to long like that:

hold.time = convert.to.long(result)
|# now result would contains the long number 7200 that is
|# equal to "02:00"

So, these were just some functions to manipulate time that I developed, there are some others in the dll, if you need functions like these ones, ask me for my dll and I will send you as soon as possible for free ok

~Vamsi
21st May 2002, 08:06
Daniel,

Thanks for the offer of sharing your dll. We have a Code & Utilities (http://www.baanboard.com/baanboard/forumdisplay.php?s=&forumid=33) forum for this purpose. Would look forward to your posting the dll in that forum.

learner
4th October 2004, 14:50
Hello,

Can somebody tell me the exact path at board from where i can download the dll, i tried searching, but could not find it.

Regards

Learner

baanhp
9th May 2013, 15:34
can u please share thedll

mark_h
9th May 2013, 17:07
On the first page of this thread it mentions both an include and a copy of the code someone shared. I do not see where they posted a formal thread in the code and utilities forum, but you should be able to use the code on the first thread.