The very moment of month end is 23 hours 59 minutes 59.99 seconds because the PostgreSQL function MonthEnd() created by PostERP returns time values with precision 0.01 second.
Next example uses function MonthEnd(), hence 2012-8-1 23:59:59.991+8 is outside of time range:
SELECT f2 FROM t52 WHERE f2 BETWEEN '2012-8-1' AND MonthEnd(2012,8,'1') |
2012-8-1 23:59:59.991+8 is within the time range specified by the next SQL statement:
SELECT f2 FROM t52 WHERE f2 BETWEEN '2012-8-1' AND TIMESTAMP WITH TIME ZONE '2012-8-1 23.59.59.99999' |
Users will get correct results in most situations by entering (date) 23:59:59.99 (time zone) as month end values.
Time zones
Overseas PostERP users managing data of a target company must understand these:
All date time values refer to the time zone of the target company.
Supposing you are entering data for company A which is in time zone UTC+8, then the following statements hold regardless of which time zone you are in:
Target company means company A. The begining of any month refers to company A's local time 00:00:00 and the end of any month refers to company A's local time 23:59:59.99. As such, all transactions recorded on or earlier than company A's local time 2012-5-31 23:59:59.99+8 are deemed as occurring in or before June, 2012.
The monthly ending date time values written by month end journal closing functions also refer to the target company's local time.
Users can choose to either include or exclude the time zones in the values when entering date time fields. For example, a Taiwan (UTC+8) user entering 2012-5-1 00:00:00+8 and 2012-5-1 00:00:00 gets the same result.
Note however, this same user entering 2012-5-1 00:00:00+9 will in fact get 2012-4-30 23:15:00+0 saved to database.
Specify companys' time zones on screen [M0F5]. |
users' time zones and the time lags between the target companys:
PostERP display date time values according to indiviual users' time zones via thin client:
Assuming you are working in Taiwan using PostERP's thin client. If you pull out a closing record from company A, then the thin client might show you the closing date time as 2012-5-31 23:59:59.99+8.
Thin client will, however, show this same record to your England coleagues the date time as 2012-5-31 15:59:59.99+0.
notes of date and time when designing dynamic report, data quick view, and business logic processor
PostERP developers are recommended to refer to Section 17.4 this document for more information. |