|
Last change
on this file since 844 was 822, checked in by bird, 22 years ago |
|
minor change.
|
-
Property cvs2svn:cvs-rev
set to
1.2
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Author Date Id Revision
|
|
File size:
863 bytes
|
| Rev | Line | |
|---|
| [821] | 1 | /* $Id: 625main.c 822 2003-10-08 13:31:15Z bird $
|
|---|
| 2 | *
|
|---|
| 3 | * TZ (tzset++) testcase.
|
|---|
| 4 | *
|
|---|
| 5 | * InnoTek Systemberatung GmbH confidential
|
|---|
| 6 | *
|
|---|
| 7 | * Copyright (c) 2003 InnoTek Systemberatung GmbH
|
|---|
| 8 | * Author: knut st. osmundsen <bird-srcspam@anduin.net>
|
|---|
| 9 | *
|
|---|
| 10 | * All Rights Reserved
|
|---|
| 11 | *
|
|---|
| 12 | */
|
|---|
| 13 | #include <time.h>
|
|---|
| 14 | #include <stdio.h>
|
|---|
| 15 | #include <stdlib.h>
|
|---|
| 16 |
|
|---|
| 17 | void printtz(void)
|
|---|
| 18 | {
|
|---|
| 19 | const char *pszTZ = getenv("TZ");
|
|---|
| 20 | tzset();
|
|---|
| 21 | printf("TZ=%s\n\ttimezone=%d\t daylight=%d\ttzname='%s','%s'\n",
|
|---|
| 22 | pszTZ,
|
|---|
| 23 | #ifdef __IBMC__
|
|---|
| 24 | _timezone,
|
|---|
| 25 | #else
|
|---|
| 26 | timezone,
|
|---|
| 27 | #endif
|
|---|
| 28 | daylight,
|
|---|
| 29 | tzname[0],
|
|---|
| 30 | tzname[1]);
|
|---|
| 31 | }
|
|---|
| 32 |
|
|---|
| 33 | int main()
|
|---|
| 34 | {
|
|---|
| 35 | printtz();
|
|---|
| [822] | 36 | putenv("TZ=PST8PDT");
|
|---|
| 37 | printtz();
|
|---|
| [821] | 38 | putenv("TZ=CET-1CDT,3,-1,0,7200,10,-1,0,10800,3600");
|
|---|
| 39 | printtz();
|
|---|
| [822] | 40 | putenv("TZ=CET-1CEST,3,-1,0,7200,10,-1,0,10800,3600");
|
|---|
| [821] | 41 | printtz();
|
|---|
| 42 | putenv("TZ=");
|
|---|
| 43 | printtz();
|
|---|
| 44 | return 0;
|
|---|
| 45 | }
|
|---|
| 46 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.