Posted to trash by kostix at Mon Jun 18 21:22:48 GMT 2007view pretty

# Palm OS Epoch:
variable timebase [clock scan "1904-01-01 00:00 UTC"]

proc palmtime {action timestamp} {
	variable timebase

	switch -glob -- $action {
		*from {
			expr {$timebase + $timestamp}
		}
		*to {
			expr {$timestamp - $timebase}
		}
		default {
			sanity error [format "bad action,\
				must be one of: convertfrom, convertto" $action]
		}
	}
}