System.Time.Clock Design Issues

Glynn Clements glynn at gclements.plus.com
Fri Feb 4 05:59:44 EST 2005


Simon Marlow wrote:

> The time zone issue is a red herring.  You can use UTC calendar time
> exclusively if you want.

I'm not entirely sure what you mean by that, but you need local
calendar times for date arithmetic, e.g. "one month from now":

	$ export TZ=Asia/Tokyo
	$ date -d '2005-02-28 23:00 UTC'
	Tue Mar  1 08:00:00 JST 2005
	$ date -d '2005-03-01 08:00 JST'
	Tue Mar  1 08:00:00 JST 2005
	$ date -d '2005-02-28 23:00 UTC +1month'
	Tue Mar 29 08:00:00 JST 2005
	$ date -d '2005-03-01 08:00 JST +1month'
	Fri Apr  1 08:00:00 JST 2005

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the Libraries mailing list