Hello Andrew,
I added the function time(), which returns the number of seconds
elapsed since 1970-01-01 00:00:00 in the local timezone. (I decided
to name this function 'time', not 'now', because 'time' is its
historical name.) As I explained earlier, if one needs to deal with
UTC, he may simply add/subtract the time offset (defined somewhere
in the model) to/from the value returned by time().
The offset between UTC and local time is not a constant due to day light
saving time.
In German local time there are only 11 hours from 00:00 on the last
sunday in march to
12:00 on the same day. There are 13 hours from 00:00 to 12:00 on the
last sunday in
october. In UTC time from 00:00 to 12:00 there are always 12 hours.
How would you express
Oct 26, 2008 02:30a (summer time) and
Oct 26, 2008 02:30b (winter time)
which are 60 minutes apart in GLPK if we used local time?
When dealing with models that span different time zones - as is often
the case in
scheduling - working in UTC is the only way to write consistent models.
I have colleagues in India and the US. How could we ever use the same model
if it was in local time?
Hence I want to have my models in UTC.
We should keep local time out of GLPK models. All numerics representing
time
should be in UTC. This will guarantee that all users will get the same
result for a model
file at the same time.
Hence time() should return the current UTC time. Please, replace
localtime by gmtime in
function time().
If a user has data in a local time this should be handled in the str2time()
(and possibly in time2str). This is why I ask for code '%z' being added
to str2time.
Best regards
Xypron
_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk