Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > Code & Utilities

User login

Frontpage Sponsor

Main

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

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
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()

Hello

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

Code:
|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(act.date)
^			sprintf$("%D(%04Y.%02m.%02d)", act.date)
#define			YYYYMMDD(act.date)
^			sprintf$("%D(%04Y%02m%02d)", act.date)
#define			DD.MM.YY(act.date)
^			sprintf$("%D(%02d.%02m.%02y)", act.date)

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

|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)
/lakoon

Last edited by lakoon : 12th October 2006 at 11:37.
Reply With Quote
Sponsored Links
  #2  
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
Baan: IV - DB: ORACLE - OS: UNIX
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)
__________________
Jensen.pan@multek.com
Reply With Quote
Reply


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 23:53.


©2001-2017 - Baanboard.com - Baanforums.com