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

  1. # Palm OS Epoch:
  2. variable timebase [clock scan "1904-01-01 00:00 UTC"]
  3.  
  4. proc palmtime {action timestamp} {
  5. variable timebase
  6.  
  7. switch -glob -- $action {
  8. *from {
  9. expr {$timebase + $timestamp}
  10. }
  11. *to {
  12. expr {$timestamp - $timebase}
  13. }
  14. default {
  15. sanity error [format "bad action,\
  16. must be one of: convertfrom, convertto" $action]
  17. }
  18. }
  19. }
  20.