Questions tagged [nstimezone]

Time Zone data for iOS and Mac OS X

NSTimeZone is a class that presents IANA time zone data as an Objective-C () class. It's part of the Foundation framework () on Mac OS X () and iOS () and in Cocotron and GNUStep.

255 questions
0
votes
2 answers

how to avoid system modify time stam, NSDate, objective c

Below is the string of time stamp which is returned by some server dateFromServer = 2013-07-08 16:45:03Z I am doing the following to convert it to an NSDate NSDateFormatter *format = [[NSDateFormatter alloc] init]; …
tranvutuan
  • 6,089
  • 8
  • 47
  • 83
0
votes
1 answer

NSDateComponents possible timezone bug?

Wonder if I've found a bug with NSDateComponents. When using NSDateComponents to calculate dates and switching between time zones, it's possible to get the wrong date on the simulator (not tested on device). It seems that it's the right offset, but…
0
votes
3 answers

NSDateFormatter returns nil for specific date only in certain time zones

Given this code: NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; [dateFormatter setDateFormat:@"yyyyMMdd"]; NSArray *datesArray = @[@"20130326", @"20130327", @"20130328", @"20130329", @"20130330", @"20130331",…
user2393462435
  • 2,652
  • 5
  • 37
  • 45
0
votes
2 answers

How to return all available system Timezones in GMT

I want to use All Available system TimeZones in GMT Format like (GMT+5:00)chennai,Mumbai,Kolkata NewDelhi Any one can help?
Vanitha
  • 91
  • 1
  • 10
0
votes
3 answers

Convert date time to NSDate from NSString

Time zone always made trouble for me. This time I have to convert date-time , that I have in NSSTring to NSDate. I am doing something like this. NSString *myStringDate=@"14-11-2012 4:09:00 PM +0500" NSDateFormatter *formatter = [[NSDateFormatter…
iOmi
  • 625
  • 10
  • 24
0
votes
1 answer

Accessing current device time in my app

I want to get current device time in my app,and continuously update that time when my device time is update.i follow that code NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"dd/mm/yy…
Shashi Sharma
  • 126
  • 1
  • 11
0
votes
2 answers

What NSTimeZone value does an NSDateFormatter use if you don't pass it in?

What NSTimeZone value does an NSDateFormatter use if you don't pass it in? I'd like to either use the default timeZone value, or pass in a given one. I'd like to do something like this: - (NSString *) announcementTime{ NSTimeZone…
Moshe
  • 57,511
  • 78
  • 272
  • 425
0
votes
1 answer

IPhone get current system time zone based time from RubyOnRails time format

Possible Duplicate: Converting an ISO 8601 timestamp into an NSDate: How does one deal with the UTC time offset? I am writing an iPhone app, which brings time from Ruby on Rails web service. The time string i get from JSON response has following…
ttotto
  • 826
  • 3
  • 13
  • 31
0
votes
1 answer

NSDates changed in UITableView Header

So I am using an array of dates as Section Headers in my UITableView. The dates of my data in the arrays is as follows 07/12/2012 07/13/2012 07/14/2012 But when I run the app the section headers are all moved back one day so they are as…
jdog
  • 10,351
  • 29
  • 90
  • 165
0
votes
1 answer

iOS - TimeZone issue with difference between 2 NSDates

I've been using NSCalendar and NSDateComponents to return the difference (in days) between 2 dates. Here's the code I'm using to get that. NSCalendar *calendar = [NSCalendar currentCalendar]; calendar.timeZone = [NSTimeZone…
mhbdr
  • 753
  • 2
  • 10
  • 26
0
votes
1 answer

UILocalNotification setTimeZone to AM/PM

How to set timeZone for UILocalNotification to AM/PM.
Nitish
  • 13,845
  • 28
  • 135
  • 263
0
votes
1 answer

How to best debug NSDate / NSTimezone related code

I know that NSDate does not represent a timezone, but perhaps someone can advise me on how to best debug its relationship to other classes, for example NSDatePicker, CalCalendarStore. As an example, I want to set the date for a date picker to…
Carelinkz
  • 936
  • 8
  • 27
0
votes
1 answer

Find next Friday at 5pm from one time zone to another

I have an NSDate with a NZDT timezone and I need to find the next Friday at EST timezone. I have searched and have used NSDateComponents to generate dates but the timezone change is messing me up. If I add 3 days to the setWeekday and the present…
Eric
  • 157
  • 1
  • 11
-1
votes
0 answers

Swift TimeZone name not returning proper Time Zone name

Has anyone run into an issue where for some users, TimeZone.identifier returns something like US/Eastern instead of the proper time zone identifier (i.e. US/New_York)? I can't seem to find any documentation about situations where this can happen, or…
Michael Berk
  • 365
  • 2
  • 16
-1
votes
2 answers

Swift - iOS Unable to convert to required date format

I am using date picker in my application. After selects particular date, It's not able to converting to required format. Datepicker date: 2021-07-21 13:53:38 +0000 expected format 21 July 2021 I am trying with below code static func…
1 2 3
16
17