It seems to me that the main answer is still not so clear, and it is worth spending time understanding time and timezones .
The most important thing to understand when working with time is that time is relative !
2017-08-30 13:23:00 : (naive datetime), represents local time somewhere in the world, but note that 2017-08-30 13:23:00 in London is NOT THE TIME like 2017-08-30 13:23:00 in San Francisco.
Since the same time line can be interpreted as different points depending on where you are in the world, there is a need for an absolute understanding of time.
A UTC timestamp is the number in seconds (or milliseconds) of an Epoch (defined as 1 January 1970 00:00:00 GMT time zone +00: 00 offset).
The era is tied to the GMT time zone and, therefore, is an absolute point in time. The UTC timestamp is an offset from absolute time, so it defines an absolute time point .
This allows you to organize events in time.
Without time zone information, time is relative and cannot be converted to the concept of absolute time without indicating some indication of in which time zone the naive datetime should be tied.
What are the types of time used in a computer system?
naive datetime : usually for displaying at local time (i.e. in a browser), where the OS can provide time zone information for the program.
UTC timestamps . The UTC time stamp is an absolute time point, as mentioned above, but it is tied to a given time zone, so the UTC time stamp can be converted to any date and time, however it does not contain time zone information. What does it mean? This means that 1504119325 corresponds to 2017-08-30T18:55:24Z or 2017-08-30T17:55:24-0100 or also 2017-08-30T10:55:24-0800 . He does not tell you where the date-time is. It is usually used on the server side to record events (logs, etc.) or used to convert time and time to time in time and calculate time differences .
String ISO-8601 datetime : ISO-8601 is a standardized format for recording date and time with a time zone. (These are actually several formats, read here: https://en.wikipedia.org/wiki/ISO_8601 ) It is used to transmit time and time information based on time in serialized mode between systems.
When to use which? or rather, when you need to pay attention to time zones?
If you need to take care of the time of day in any way, you need time zone information. A calendar or an alarm clock needs the time of day to set an appointment at the right time of day for any user in the world. If this data is stored on the server, the server must know which time zone corresponds to the date-time.
To calculate the time differences between events occurring from different places in the world, the UTC timestamp is sufficient, but you lose the ability to analyze what time of the day the events occurred (i.e. for web analytics, you may want to know when users come to Your site in your local time : Do you see more users in the morning or in the evening? You cannot understand this without information about the time of day.
Time zone offset in date line :
Another important point is that the clockwise offset in the date string is not fixed . This means that since 2017-08-30T10:55:24-0800 says that the offset is -0800 or 8 hours ago, does not mean that it will always be!
In summer it can be summer time and it will be -0700
This means that the time zone offset (+0100) does not match the time zone name (Europe / France) or even the time zone designation (CET)
America/Los_Angeles Time Zone is a place in the world , but in winter it includes PST (Pacific Standard Time) clockwise rotation and PDT (Pacific Daylight Time) in summer.
So, instead of getting the time zone offset from the date, you should also get the exact name of the time zone.
Most packages will be able to convert numerical offsets from daylight saving time to standard time on their own, but this is not necessarily trivial with just an offset. For example, the WAT time zone designation in West Africa is UTC + 0100, just like the time zone in France, but France marks daylight saving time, while in West Africa it’s not (because they are close to the equator)
So, in a word, it's complicated. VERY complicated, and why you should not do it yourself, but trust the package that does it for you, and KEEP IT BEFORE THE DATE!