Use gw.api.util.DateUtil instead of java.util.Date
As a best practice, Guidewire
recommends that you use the utility functions of gw.api.util.DateUtil instead java.util.Date in working with
dates. Each class provides a set of utility functions that operate on
date and time data. Guidewire recommends using the DateUtil methods, however, as
the utility functions in DateUtil
derive their time from the PolicyCenter
database time. In contrast, the java.util.Date
functions derive their time from PolicyCenter application time.
Important: If you intend to
do time-based testing, any dates affected by your implementation of the
ITestingClock plugin must
use the DateUtil utility
functions.See also
