IOS组件从日期更改时区

时间:2015-09-24 12:38:18

标签: ios nsdate nsdatecomponents

我正在使用

2016-01-04 05:00:00 +0000
2015-10-26 04:00:00 +0000

我从API收到的日期。

_date根据日历日返回2个不同的输出:

2016-01-04 05:00:00 +0000
2015-12-21 05:00:00 +0000
2015-12-14 05:00:00 +0000
2015-12-07 05:00:00 +0000
2015-11-23 05:00:00 +0000
2015-11-16 05:00:00 +0000
2015-11-09 05:00:00 +0000
2015-11-02 05:00:00 +0000
2015-10-26 04:00:00 +0000
2015-10-19 04:00:00 +0000
2015-10-22 04:00:00 +0000
2015-10-01 04:00:00 +0000
2015-09-24 04:00:00 +0000

好像时区有变化。

是否有理由_date的时间从5变为4?有什么可以阻止的吗?

问题是我在使用dateFromComponents创建的所有其他日期中反映出意外的时间偏移(-1):components

显示偏移的不同日期的输出

<Server port="8015" shutdown="SHUTDOWN">

    <Service name="Catalina">
        <Connector port="8081" enableLookups="false"/>

<Connector
           protocol="org.apache.coyote.http11.Http11AprProtocol"
           port="8443" maxThreads="200"
           scheme="https" secure="true" SSLEnabled="true"
           SSLCertificateFile="/opt/artifactory-oss-4.1.2/tomcatcert.pem" 
           SSLCertificateKeyFile="/opt/artifactory-oss-4.1.2/tomcatkey.pem"
           SSLVerifyClient="optional" SSLProtocol="TLSv1+TLSv1.1+TLSv1.2"/>

        <!-- This is the optional AJP connector -->
        <!--Connector port="8019" protocol="AJP/1.3"/-->

        <Engine name="Catalina" defaultHost="localhost">
            <Host name="localhost" appBase="webapps"/>
        </Engine>

    </Service>
</Server>

0 个答案:

没有答案