38
38
test "Specified Zone" {
39
39
if not date :zone "+0200" "date" "zone" "+0200" {
40
40
if date :matches :zone "+0200" "date" "zone" "*" {}
41
test_fail "zone is incorrect: ${0}";
41
test_fail "zone is incorrect: ${0}";
44
44
if not date :zone "+0200" "date" "time" "20:44:43" {
45
test_fail "zone is not applied";
45
test_fail "zone is not applied";
49
49
test "Original Zone" {
50
50
if not date :originalzone "date" "zone" "+0300" {
51
51
if date :matches :originalzone "date" "zone" "*" {}
52
test_fail "zone is incorrect: ${0}";
52
test_fail "zone is incorrect: ${0}";
55
55
if not date :originalzone "date" "time" "21:44:43" {
56
test_fail "time should be left untouched";
56
test_fail "time should be left untouched";
60
60
test "Local Zone Shift" {
63
63
string "${local_zone}" "+0200",
64
64
date "delivery-date" "iso8601" "2009-07-23T05:30:14+08:00"),
66
66
not string "${local_zone}" "+0200",
67
67
date "delivery-date" "iso8601" "2009-07-22T23:30:14+02:00")) {
69
if date :matches "delivery-date" "iso8601" "*"
69
if date :matches "delivery-date" "iso8601" "*"
70
70
{ set "a" "${0}"; }
71
if date :originalzone :matches "delivery-date" "iso8601" "*"
71
if date :originalzone :matches "delivery-date" "iso8601" "*"
72
72
{ set "b" "${0}"; }
74
74
test_fail "time not shifted to local zone: ${b} => ${a}";