You can get Longitude and Latitude using CoreLocation.
add this in your .h class where you want the latitude and longitude.
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
@interface CoreLocationViewController : UIViewController <CLLocationManagerDelegate> {
CLLocationManager *locationManager;
}
@property (retain, nonatomic) CLLocationManager *locationManager;
@end
And in your .m file
#import "CoreLocationViewController.h"
@implementation CoreLocationViewController
@synthesize locationManager;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[self setLocationManager:[[CLLocationManager alloc] init]];
[locationManager setDelegate:self];
[locationManager setDistanceFilter:kCLDistanceFilterNone];
[locationManager setDesiredAccuracy:kCLLocationAccuracyHundredMeters];
[locationManager startUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
NSLog(@"My Latitude %f",newLocation.coordinate.latitude);
NSLog(@"My Latitude %f",newLocation.coordinate.longitude);
}
And for the current TimeZone you can use
NSTimeZone* currentTimeZone = [NSTimeZone systemTimeZone];
NSDateFormatter *dateFormatter = [dateFormat setTimeZone:currentTimeZone];
NSDate *rightNow = [NSDate date];
NSString *dateString = [dateFormatter stringFromDate:rightNow];