Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 11th January 2003, 07:43
learner's Avatar
learner learner is offline
Guru
 
Join Date: Dec 2002
Location: New zealand
Posts: 562
learner is on a distinguished road
Baan: BaaN Vc with sp 28 - DB: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit - OS: HP-UX B.11.31
how to get current date ?

hi,

how can i get the current date ? please tell me also the domain or data type which i will use for it.

i require this current date to further compare it with another date which is stored in table.
Reply With Quote
  #2  
Old 11th January 2003, 08:04
morpheus's Avatar
morpheus morpheus is offline
Guru
 
Join Date: Jun 2002
Location: Planet of the apes
Posts: 369
morpheus is on a distinguished road
Baan: BaaN IV c4 - DB: BaaN Base - OS: HP-UX 11
Use date.num() for the system date, and you can use domain tcdate.
Reply With Quote
  #3  
Old 11th January 2003, 17:41
Renegade's Avatar
Renegade Renegade is offline
Senior Member
 
Join Date: Sep 2001
Location: Norway
Posts: 221
Renegade is on a distinguished road
Baan: BaaNERP5.0c - DB: Oracle - OS: Windows
and in BaanERP

IN case u use BaanERP, u may like using utc.num()
It gives u the time along with date
Reply With Quote
  #4  
Old 13th January 2003, 02:53
Paul P's Avatar
Paul P Paul P is offline
Guru
 
Join Date: Jul 2002
Location: Jakarta, Indonesia
Posts: 797
Paul P is on a distinguished road
Baan: BaanIV, BaanERP - DB: SQL Server, Informix, Oracle - OS: Windows, HP-UX
Smile Yet another one

Dear learner,

You can also use the built in variable date$. It is a string of length 6 and will give the current date in form of DDMMYY

Rgds,
Paul
Reply With Quote
  #5  
Old 13th January 2003, 15:55
sbakshi's Avatar
sbakshi sbakshi is offline
Junior Member
 
Join Date: Jan 2002
Location: USA
Posts: 24
sbakshi is on a distinguished road
Baan: BaaN 4c4 - DB: ORACLE - OS: UNIX, WINDOWS
Another one

Hi,

string new.date(8)
string help.date(12)
help.date=dte$()
new.date=help.date(3;2)&"/"&help.date(1;2)&"/"&help.date(5;2)
new.date now contains today in the format dd/mm/yy

Thnx
Sanjiv
Reply With Quote
  #6  
Old 13th January 2003, 23:10
ltannous's Avatar
ltannous ltannous is offline
Senior Member
 
Join Date: Sep 2002
Location: Canada
Posts: 280
ltannous is on a distinguished road
Baan: 4c4 - DB: Oracle - OS: UNIX
date.num() works great, how can I get the day

when using date.num(), that returns the date, how can I figure out if today is Monday or Tuesday...
Reply With Quote
  #7  
Old 13th January 2003, 23:15
sbakshi's Avatar
sbakshi sbakshi is offline
Junior Member
 
Join Date: Jan 2002
Location: USA
Posts: 24
sbakshi is on a distinguished road
Baan: BaaN 4c4 - DB: ORACLE - OS: UNIX, WINDOWS
Try this

Hi,

domain tcdate date, wekd
date = date.num()
wekd = 1+(date\7) | or
wekd = 1+ (date.num() )\7

Explanation:
(date.num() ) \7

The above expression returns the remainder between zero and 6.

As Baan starts counting from 1, we add one to get 1 through 7.
1 always represents Sunday, and 7 represents Saturday.

Thanks
Sanjiv
Reply With Quote
  #8  
Old 13th January 2003, 23:47
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,032
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
Refer to the tools manual for - sprintf$()
Quote:
%D(format)
Use for dates.

This option enables you to define your own date format by using the following subformats of the ‘%D’ format:

%a name of day (‘Sun’ - ‘Sat’)
(abbreviated)
%A name of day (‘Sunday’ - ‘Saturday’)
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
Sponsored Links
  #9  
Old 14th January 2003, 00:04
lbencic's Avatar
lbencic lbencic is offline
Guru
 
Join Date: Dec 2001
Location: Lisle, IL, USA
Posts: 1,148
lbencic will become famous soon enough
Baan: 2.2d - LN - DB: most - OS: most
The day of the week is dependent of your First Day of the week setup in Maintain Companies. The same division etc. and hardcoding will only work for specific companies. If you change the first day of the week, or move the code to a company with a different first day of the week, it will act differently. (Ugh..I know from bad experiences!).
The way Baan does this is to have created a function (in Baan IV) to use. I use this as follows:

Code:
long   current.week.dayno, current.year.dayno, current.week, current.year
domain tcdate  current.date
domain tcdayn  current.dayn

current.date = date.num()
num.to.week(current.date, current.week.dayno,  
                      current.year.dayno, current.week, current.year) 
current.dayn = itihra0001.convert.daynumber.to.dayname(current.week.dayno)

Then the enumerated variable current.dayn will have the correct day of the week, regardless of your first day of week.

This requires the source code for the standard Baan function tihra0001. Even if you do not have source code in general, you should be able to request this source from Baan. I have found they will give out the 'building block' functions needed to get everything else working.

Edit: I just saw Rao's post. The sprintf option can also be very handy!
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 On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Current date as an Initial Value kjetil-a Tools Development 6 21st September 2005 16:07
Current date Harley Tools Development 6 25th February 2004 19:39


All times are GMT +2. The time now is 03:22.


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