开发者

How can I get current time in a +7 timezone on iPhone?

I want to get the +7 timezone 开发者_Go百科on iPhone, how can I do so? Thank you.


If you want to output the date, create an NSDateFormatter instance and set its time zone to the one you want. Then use the date formatter to create the date string.

If you want to get the date components (day, hour, etc.) of a date in a given time zone, create an NSCalendar instance, set its time zone accordingly, and send a components:fromDate: message to the calendar object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜