<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/da/onlinemanual/000050" xml:lang="en">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">dadlldate_time</Title>
	</Header>
	<GeneralSection><GeneralSection><SectionTitle>DLL Usage description</SectionTitle>
			<Paragraph class="Default">Library: dadlldate_time</Paragraph>
			<Paragraph class="Default">This library contains common functionality that operates on date and time fields, values and constants</Paragraph>
		</GeneralSection>
		<GeneralSection><SectionTitle>DLL Prototypes</SectionTitle>
			<Formula space-and-orientation="indented-estimated"><Paragraph class="Default"> function extern date.const.disp.to.store(
         domain daxch.dfor dfor,
         const string disp.field(),
         ref string store.field())
 pre   : true post  : store.field contains the value of disp.field as it should
be
        stored desc: : - expression with # will be copied unchanged
        - formatted date will be converted to a datenumber
          (converted to a string)
 function extern long date.const.enter.to.disp(
         domain daxch.dfor dfor,
         ref string disp.field())
 pre   : true return: whether disp.field is a valid date constant post  : ret =
true  ==&gt; disp.field will contain the value as
        old(disp.field) should be displayed
        ret = false ==&gt; disp.field will be left unchanged desc  : a correctly
entered date constant should be displayed as
        follows: - date.num() will be replaced by #
                 - [(+-)[n]] will be displayed by the indicated date
                   (formatted)
                 - formatted dates will be displayed unchanged
 function extern date.const.store.to.disp(
         domain daxch.dfor dfor,
         const string store.field(),
         ref string disp.field())
 pre   : true post  : disp.field contains the value of store.field as it should
      : be displayed: desc  : - expression with # will be copied unchanged
        - a datenumber will be converted to a formatted date
         (converted to a string)
 function extern long date.to.format(
         domain daxch.dfor dfor,
         long ndate )
 pre   : true return: dfor and ndate are valid ==&gt; the formatted date
representation
                                     of ndate
        otherwise ==&gt; ndate (ndate is regarded to be a date number)
 function extern string datestr.to.formatstr(
         domain daxch.dfor dfor,
         const string sdate() )
 pre   : true return: dfor and sdate are valid ==&gt; the formatted date
representation
                                     of sdate (converted to a string)
        otherwise ==&gt; sdate (sdate is regarded to be the string
                      representation of a date number)
 function extern long format.to.date(
         domain daxch.dfor dfor,
         long fdate )
 pre   : true return: dfor and fdate are valid ==&gt; the date number of fdate
        otherwise ==&gt; fdate desc  : if the year is in YY format the century must
be guessed:
        YY &lt; 50 then 21st century else 20th century
 function extern string formatstr.to.datestr(
         domain daxch.dfor dfor,
         const string sfdate())
 pre   : true return: dfor is valid and sfdate is valid ==&gt; the date number of
fdate
                                              as a string
        otherwise ==&gt; str$(lval(sfdate)) (this might loose information) desc  :
if the year is in YY format the century must be guessed:
        YY &lt; 50 then 21st century else 20th century
 function extern long get.date.format.length(domain daxch.dfor dfor)
 pre   : true return: the length of a date according to dfor,
         - 6 for a date number and a format with YY
         - 8 for a format with YYYY
         - 0 for an invalid format
 function extern get.next.interval(
         ref domain daxch.utc date.f,
         ref domain daxch.utc date.t )
 pre   : the parameters denote a time-interval post  : the parameters contain
the next interval, ie the interval
        starting at the end of the given interval and having the same
        length as the given one, or more 'precise':
        - date.f = old(date.t) AND
        - date.t = date.f + ( old(date.t) - old(date.f))
 function extern long hhmmss.to.secs(long hhmmss)
 return: hhmmss converted to # seconds since midnight
 function extern long secs.to.hhmmss(long secs)
 return:  secs (the number of seconds since midnight) converted to hhmmss
 function extern long utc.date.and.time.to.utc(
         domain daxch.date date,
         domain daxch.time time,
         ref domain daxch.utc utc.date )
 pre   : date and time contain a utc date/time;
        format of date: date number, format of time: hhmmss. return: True if the
utc date was converted successfully. post  : If return then utc.date contains
the same date/time
        as date and time, but in utc format. note  : No conversion from local
time to utc is done;
        only the date and time are reformatted into a single
        utc variable.
 function extern long utc.to.utc.date.and.time(
         domain daxch.utc utc.date,
         ref domain daxch.date date,
         ref domain daxch.time time)
 pre   : utc.date is a date in utc format. return: True if the utc date was
converted successfully. post  :If return then date and time contain the same
date/time
       as utc.date, but in a different format:
       format of date: date number, format of time: hhmmss. note  :No conversion
from utc to local time is done;
       only the utc.date is split up into two variables, because
       the audit server uses a separate date and time.
</Paragraph>
			</Formula>
		</GeneralSection>
	</GeneralSection>
	<RelatedTopics><SectionTitle>
                              Related topics
                           </SectionTitle>
		<RelTopic><Link href="/baanerp/da/onlinemanual/000102" role="manual">Libraries</Link>
		</RelTopic>
	</RelatedTopics>
</ManualTopic>
