|
Tip>Designer |
|
|
Compare dates in different formats |
|
|
Article #: |
0019 |
|
Contributor: |
Daniel Todes |
|
GF version: |
All |
|
Applies to: |
Dates in different formats |
|
Last updated: |
October 19, 2001 |
Description
Compare two dates that are in different formats.
Explanation
The Calendar server is designed specifically to do date comparison work. Depending on the outcome you are trying to achieve, there are tasks that give the results in days, weeks, months or years. The beauty of the Calendar server is that the dates being compared can be in different formats.
Click here to view an example.
You may need to check a date that is entered into a field in a Dialog against another date, in order to continue processing. The following FillPoint uses the difference between the two dates to determine the Document Logic:
%[KeepBlockIf(Calendar.Days(Lease.Date_Effective,'June 1, 2001')<0)]
In this example, Lease.Date_Effective is a date field in a database. The succeeding block of text will then be kept if the date in the field is later than June 1, 2001. The date value in the field can be in either the short date style, e.g. 7/23/01, or the long date style, e.g. July 23, 2001. The Calendar server will be able to make the comparison.
|
NOTE |
|
The Calendar server relies on the Regional settings of the system to resolve the formatting differences. Because the Windows short date style may vary from one system to another, it is advisable to set a default format for all date values in a document using the SetDateFormat task. (See the GhostFill Scripting Language Guide for a detailed description of all the Date tasks.) |