This problem has actually been encountered several times, and many things have not been carefully studied. The solution is also very violent and directly added for 8 hours.
After debugging, I found that this is not the case.
NSDate * nowDate = [NSDate date]; // The time here is CST time. The variable value is correct in the variable View window.
However, if you print it out using NSLog (@ "nowDate: % @", nowDate), you will find that eight hours are missing;
I tried to use DateFormater to convert time to string and string to time, and view the value of the time variable. That is to say, only NSLog (@ "nowDate: % @", nowDate) when the time object is printed directly, the display time is 8 hours less.
The format of time in NSLog is converted by GMT time. In this way, the conversion will be less than 8 hours, and the solution is also very simple. Just do not print it like this, how to Use the Internal Computing in the code, but when it comes to operations that need to be displayed on the interface or that need to be assigned with a print value, use DateFormater to format it as the required string, and then you can use it with confidence.