spatters
5th February 2004, 00:00
What is the standard way to store date and time in Baan? Please define how the columns are defined as well as how to capture the data.
Example: I need to capture when an order is entered. I need the username, date and time entered.
Hitesh Shah
5th February 2004, 09:30
I think the post is made in the wrong forum. It should be in the tools development forum.
Date field has to be defined with a domain of type date (ie tcdate) and time has to be defined with type long (eg tctime)
In Baan IV the current system values can be used in the following manner.
date_field = date.num()
time_field = time.num()
For date fields there are number of functions in Baan help to manipulate date values from date,month,week and year. For time u may need to write algorithm to get the hour,minute and seconds.if u use time.num() function like
long hh,mm,ss
hh = time_field / 3600
mm = (time_field\3600) / 60
ss = (time_field\3600) \ 60
lbencic
5th February 2004, 16:54
Yep, and this is somewhat different in Baan V. Pls. fill out your profile with your Baan version so we know which functions are relative to you.
In Baan V, they store the date and time together, and use the function utc.num() instead of date.num(). Also there are then functions to break the date and time down to it's components:
domain tcdate my.date
long my.year, my.month, my.month.dayno, my.hours, my minutes, my.seconds
my.date = utc.num()
utc.to.date(my.date, my.year, my.month, my.month.dayno, my.hours, my.minutes, my.seconds)
Check the programmers guide for the date functions, there are plenty. This link to the Wiki has them all :)
http://www.baanboard.com/programmers_manual_baanerp_help_functions_date_time_zones_synopsis
Note that the date.* functions are mostly related to Baan IV, and the utc.* functions are mostly used in Baan V.
bdittmar
5th February 2004, 19:20
Originally posted by spatters
What is the standard way to store date and time in Baan? Please define how the columns are defined as well as how to capture the data.
Example: I need to capture when an order is entered. I need the username, date and time entered.
table.field_a date.num() [domain tc.date]
table.field_b time.num() [domain tc.time]
table.field_c logname$ [domain tcmcs.str16]
date.num() is actual system date
time.num() is actual system time
logname$ is actual logged in BaaN user
regards Bernd