libs-base/Testing/nstimezone.m
Adam Fedor 42b269b0fc * configure.ac: Check for tzfile.h
* Source/NSTimeZone.m: Include system tzfile.h if found.
(abbreviationMap): Add abbreviation from systemTimeZone if not
already there.
(systemTimeZone): Update the search list to look for time zone in TZ,
then system location, then tznam.
(getTimeZoneFile:): Look for file in system directory first.
* Source/nstzfile.h: Renamed from tzfile.h


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20217 72102866-910b-0410-8b05-ffd578937521
2004-10-11 03:08:54 +00:00

29 lines
690 B
Objective-C

/* Test time zone code. */
#include <stdio.h>
#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSDate.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSTimeZone.h>
int
main ()
{
NSTimeZone *system;
CREATE_AUTORELEASE_POOL(pool);
GSPrintf(stdout, @"System time zone\n");
system = [NSTimeZone systemTimeZone];
GSPrintf(stdout, @" %@\n\n", [system description]);
GSPrintf(stdout, @"Local time zone:\n %@\n\n",
[[NSTimeZone localTimeZone] description]);
GSPrintf(stdout, @"Time zones for PST:\n %@\n",
[[[NSTimeZone abbreviationMap] objectForKey: @"PST"] description]);
RELEASE(pool);
return 0;
}