SandraDiehl
26th January 2007, 18:40
I have a stored date and time in two different fields (long) that I need to be able to display to users in a "friendly" manner. Date I'm using function num.to.date$ to get into a better format. What I'm looking for is the funciton to use for the time so it will be displayed in hh:mm:ss. Any help would be great. Thanks
htown19
26th January 2007, 20:35
Try using the function dte$ in place of num.to.date$. I have included an example below that may help you with this.
Example
This example prints the current time in the format HH:MM:SS.
string dat(12)
dat = dte$()
print dat(7;2), ":", dat(9;2), ":", dat(11;2)
bdittmar
26th January 2007, 20:42
I have a stored date and time in two different fields (long) that I need to be able to display to users in a "friendly" manner. Date I'm using function num.to.date$ to get into a better format. What I'm looking for is the funciton to use for the time so it will be displayed in hh:mm:ss. Any help would be great. Thanks
Hello,
use BaanERP Programmers Guide
time.num()
--------------------------------------------------------------------------------
Syntax
long time.num()
Description
This returns the current time as the number of seconds since 00:00.
Return value
The current time as the number of seconds since 00:00.
Maybe this link helps ?
http://www.baanboard.com/baanboard/showthread.php?t=24211&highlight=time.num%28%29
dilipk.pandey
29th January 2007, 11:39
Dear Sandra,
dte$ returns the current date and current system time together, so if your objective is to display the system time then go for this, but yet you will have to formate it. Store the value in a string array and using dimensions trim the the values from it to varriable, and conct ":" using "&".. (u can find an example in programer's guide for BaaN...)...time.num returns the secconds from current date and that too not formatted...go through this link to know more about formatting...http://www.baanboard.com/baanboard/showthread.php?t=24211&highlight=time.num%28%29
I hope you can do it...
Cheers.
Dilip.
SandraDiehl
29th January 2007, 15:50
Thanks for all the replies that I have gotten so far. I know how to do a current system time, that's not the issue. Issue is I have a time stored in a table (used to logged date and time last updated) and that time is stored the BaaN way which would be for example: in the table I will have the value 76508 and the real value would be: 9:15:08PM. I have this slick tool called BaaN Data and Time Conversion that does exactly what I want, but have no clue on how they did it.
I can do the date using num.to.date$ function but haven't found the one that will do the time.
mr_suleyman
29th January 2007, 15:57
Why don't you try to keep dte$() information on your table ? I can easily get date and time information.
Good Luck !
dorleta
30th January 2007, 14:06
watch the include tfgld0032. It provide the function that you need
mark_h
30th January 2007, 15:39
Or write your own:
function extern string dtm(long tm) | display (format) time HH:MM:SS
{
long ttm
ttm = tm\86400
return( sprintf$("%02s:%02s:%02s",ttm/3600,ttm\3600/60,ttm\60))
}
I think I "borrowed" the basis of this from Gordon.
SandraDiehl
31st January 2007, 14:51
I went ahead and wrote my own function. Issue with my company we don't have source code so not only am I not able to look at code I can't use some of the existing functions.
Thanks all for your input.:)