简体   繁体   English

iOS使用本地时区设置ekevent开始时间

[英]iOS setting ekevent start time with local time zone

In my iOS application, I'm showing date picker through which user can select at what time they want to select to store the event in calendar. 在我的iOS应用程序中,我正在显示日期选择器,用户可以通过该日期选择器选择他们想要选择何时在日历中存储事件。 i am using event kit for this. 我正在使用事件工具包。
This is working fine. 这工作正常。 But the problem is that its creating the even in GMT time zone. 但问题是它在GMT时区创造了均匀。 How can I create an event in calendar according to local time. 如何根据当地时间在日历中创建活动。

I found the solution: We don't have to convert data to local time zone. 我找到了解决方案:我们不必将数据转换为本地时区。 We've to set the start date in GMT time zone and event kit will handle the conversion to local time zone and show it. 我们要在GMT时区设置开始日期,事件工具包将处理转换到本地时区并显示它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM