English 中文(简体)
A. 指定国家可持续发展局,具体日期、时间和时间
原标题:Setting an NSDate to specific date, time and timezone

我需要为“ipe App”确定一个具体日期、时间和时间区。

下面的缩略语是第4号,因为第4号标准是在Si4号。 我如何在不使用固定装置的情况下,轻而易地确定国家SDate。 时间,可以将其用于Si-3.0装置?

    NSDateComponents *comps = [[NSDateComponents alloc] init];
[comps setYear:2010];
[comps setMonth:8];
[comps setDay:24];
[comps setHour:17];
[comps setMinute:5];
[comps setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"] ];

NSCalendar *cal = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDate *referenceTime = [cal dateFromComponents:comps];

这一点应当简单明了,但有些是可持续发展基金会、组成部分和日历,我不是好朋友。

最佳回答

我很想知道,你能否在<条码>上设定时间区。 我没有尝试过,也没有知道它是否干活,但可能值得尝试。

问题回答

国家本身没有时间区的概念。 自格林尼治时某个任意日期以来,这些变化基本上都是次要的。 因此,你可以给他们一个时间区。 如果时间区很重要,你就需要跟踪时间和时间区。





相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...

热门标签