Go Back > Forum > Baan SIGs > Code & Utilities

User login

Frontpage Sponsor


For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
Installation Wizard into new VRC
Manual into existing VRC
Manual into new VRC
Total votes: 31

Baanboard at LinkedIn

Reference Content

Thread Tools Display Modes
Old 3rd June 2005, 09:15
lakoon's Avatar
lakoon lakoon is offline
Senior Member
Join Date: Jul 2003
Location: Switzerland
Posts: 179
lakoon is on a distinguished road
Baan: Triton 2.0, Baan IV b/c /ERP /ERP LN - DB: Oracle / tbase / MSSQL - OS: Solaris / HP /Windows
Converting Time String from time.num()


I just wrote this small define to make the time conversion a little bit easier:
added some more macro's

|You can use it in the sprintf$ function to format the date
|Usage: string = sprintf$(YYYYMMDD, date.num())
|Usage: string = sprintf$(YYMMDD, date.num())
#define			YYYYMMDD	"%D(%04Y%02m%02d)"
#define			YYMMDD		"%D(%02y%02m%02d)"

|This returns a string in the various formats
|Usage: string = YYYY.MM.DD(date.num())
|Usage: string = YYYYMMDD(date.num())
|Usage: string = DD.MM.YY(date.num())
#define			YYYY.MM.DD(
^			sprintf$("%D(%04Y.%02m.%02d)",
#define			YYYYMMDD(
^			sprintf$("%D(%04Y%02m%02d)",
#define			DD.MM.YY(
^			sprintf$("%D(%02d.%02m.%02y)",

|This returns the week and year for a given date
|Usage: string = WW.YYYY(date.num())
#define			WW.YYYY(
^			sprintf$("%D(%02w.%04Y)",

|This returns the given time in a string with desired sign between hours, minuts and seconds
|Usage: string = HHMMSS(time.num(), "<your sign>")
#define			HHMMSS$(act.time, deli)
^			sprintf$("%02d%s%02d%s%02d", act.time/3600, deli,
^				(act.time\3600)/60, deli, (act.time\3600)\60)

|This returns the given time as a long
|Usage: long = HHMMSS(time.num()) |Actual time.num()= 36030 results in 100030
#define			HHMMSS(t)
^			((t/3600)*10000) + (((t\3600)/60)*100) + ((t\3600)\60)

|This returns the seconds for given hour, minute and second (expl. User input)
|Usage: long = SECONDS(10, 00, 00) |10 am = 36000 Seconds
#define			SECONDS(h, m, s)
^			((h*3600) + (m*60) + s)

Last edited by lakoon : 12th October 2006 at 11:37.
Reply With Quote
Old 27th December 2005, 07:51
panote's Avatar
panote panote is offline
Junior Member
Join Date: Jan 2003
Location: guangdong
Posts: 4
panote is on a distinguished road
other way

string time1(6)
string time2(8)
string dat(12)
dat = dte$()
time1 = dat(7;6)
time2 = dat(7;2) &":" &dat(9;2) &":" & dat(11;2)
Reply With Quote
Sponsored Links

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
number to words ncgjiju Tools Development 7 27th May 2005 13:37
Baan & Connectware Driver Hangs Rajasekhar Tools Administration & Installation 2 18th February 2004 21:32
File Browser Bogdan Tools Development 52 7th January 2004 08:17

All times are GMT +2. The time now is 21:29.

©2001-2017 - -