I was reading case notes earlier today and found this note: 638613.1 which explains how PeopleSoft gets datetime.
Prior to PeopleTools 8.46 we had an issue with the way %DateTime retrieved the datetime value. The information below is not a direct solution to the behavior described above. This is an explanation of how the
%DateTime function worked prior to PeopleTools 8.46, and how/why it was changed.
When the Process Scheduler or Application Server is started, the host server’s system time and the time from the database is retrieved. The difference between the server’s system time and the time from the database is stored as permanent value. From this moment forward, whenever the Date/Time/or DateTime is requested we get the system time from the host server, and apply the difference that was originally calculated between the system time and the database time. The was done to avoid the overhead of going to the database for every request. The problem with this approach was that over time the clocks on the database and the process scheduler/appserver might not be ticking at the exact same rate. If your process scheduler and/or appserver have not been rebooted for a long time, you could possibly see a difference of up to 5 minutes or more between the database time and the server’s system time.
The change that was made in PeopleTools 8.46 was to call a function that will retrieve and save the time from the database. When the function is called (it is called whenever someone logs on through PIA or a new batch process starts), and it has not issued the SQL to get the time from the database for over 20 minutes, the process scheduler and/or appserver will issue the SQL to retrieve the time from the database. If it has been less than 20 minutes, then a calculation similar to the one described above is used.