Posted to tcl by kbk at Wed Mar 07 23:46:35 GMT 2007view raw

  1. test clock-56.1 {use of zoneinfo, version 1} \
  2. -setup {
  3. clock format [clock seconds]
  4. set tzdir [makeDirectory zoneinfo]
  5. set tzdir2 [makeDirectory Test $tzdir]
  6. set tzfile [makeFile {} PhoenixOne $tzdir2]
  7. set f [open $tzfile w]
  8. fconfigure $f -translation binary
  9. puts -nonewline $f [binary format c* {
  10. 0x54 0x5a 0x69 0x66 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  11. 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x03
  12. 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0a
  13. 0x00 0x00 0x00 0x03 0x00 0x00 0x00 0x0c 0x9e 0xa6 0x3a 0x90
  14. 0x9f 0xbb 0x07 0x80 0xa0 0x86 0x1c 0x90 0xa1 0x9a 0xe9 0x80
  15. 0xcb 0x89 0x0c 0x90 0xcf 0x17 0xdf 0x1c 0xcf 0x8f 0xe5 0xac
  16. 0xd0 0x81 0x1a 0x1c 0xfa 0xf8 0x75 0x10 0xfb 0xe8 0x58 0x00
  17. 0x00 0x01 0x00 0x01 0x02 0x01 0x02 0x01 0x00 0x01 0xff 0xff
  18. 0xab 0xa0 0x01 0x00 0xff 0xff 0x9d 0x90 0x00 0x04 0xff 0xff
  19. 0xab 0xa0 0x01 0x08 0x4d 0x44 0x54 0x00 0x4d 0x53 0x54 0x00
  20. 0x4d 0x57 0x54 0x00 0x00 0x00 0x00 0x00 0x00 0x00
  21. }]
  22. close $f
  23. set ::tcl::clock::ZoneinfoPaths \
  24. [linsert $::tcl::clock::ZoneinfoPaths 0 $tzdir]
  25. ::tcl::clock::ClearCaches
  26. } \
  27. -cleanup {
  28. set ::tcl::clock::ZoneinfoPaths \
  29. [lrange $::tcl::clock::ZoneinfoPaths 1 end]
  30. ::tcl::clock::ClearCaches
  31. removeFile PhoenixOne $tzdir2
  32. removeDirectory Test $tzdir
  33. removeDirectory zoneinfo
  34. } \
  35. -body {
  36. clock format 1072940400 -timezone :Test/PhoenixOne \
  37. -format {%Y-%m-%d %H:%M:%S %Z}
  38. } \
  39. -result {2004-01-01 00:00:00 MST}