アプリで時間を設定する必要があります。サーバーからタイム スタンプ (GMT) を取得しました。ユーザーの現在のタイム ゾーンに基づいて、そのタイム スタンプを日付に変換する必要があります。どのように可能ですか?
NSDate *date = [[NSDate alloc] initWithTimeIntervalSince1970:@"1340907963"];
NSDateFormatter *dFormat = [[[NSDateFormatter alloc] init] autorelease];
[dFormat setDateStyle:NSDateFormatterMediumStyle];
[dFormat setDateFormat:@"d.MM.yyyy"];
NSString *theDate = [dFormat stringFromDate:date];
これが、タイムスタンプを日付に変換した方法です。そして、2012 年 6 月 20 日 23:55 のようなものを出力しました。しかし、私の実際の時間は18:55です