mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
* 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
29 lines
690 B
Objective-C
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;
|
|
}
|