@@ -142,10 +142,27 @@ _**Note:** Order descending chronologically._
142
142
143
143
### Why not simply convert all times to UTC?
144
144
145
- As timezones are based on political definitions. Therefore they change: regularily and unforseeably. And sometimes even
146
- for past times. So when you are converting a DateTime to UTC you are using the offset that is known today
147
- to convert from the local time to UTC. When that offset changes due to political decisions then you have no chance to
148
- adapt to that.
145
+ ` now() ` should be considered to be the equivalent of checking your wallclock at home or your wristwatch.
146
+ It usually gives you the current point in time at your current location. And from that point you can
147
+ then – if you need to – transpose to other timezones. That makes life much easier than setting your
148
+ wallclock to UTC and having to transpose every time you want to communicate with someone.
149
+
150
+ As this interface is a generic interface it can not impose a certain usecase and therefore needs to
151
+ be as open as possible. That means to allow people to use any DateTimeImmutable object possible.
152
+ And that also means to make sure users understand the consequence of that. Which is that it is
153
+ the users requirement to make sure the returned DateTimeImmutable object conforms to their requirements.
154
+
155
+ Much as you would tell someone calling you on the phone your local time when they ask you for the time.
156
+ And if they have some special requirements they need to make sure that they handle the information
157
+ you gave them properly.
158
+
159
+ Besides that it has shown that transposing times is usually error prone and should be avoided at
160
+ all cost and only done if absolutely necessary.
161
+
162
+ That is due to timezones being based on political definitions. Therefore they change: regularily and unforseeably.
163
+ And sometimes even for past times. So when you are converting a DateTime to UTC you are using the
164
+ offset that is known today to convert from the local time to UTC. When that offset changes due
165
+ to political decisions then you have no chance to adapt to that.
149
166
150
167
An Example: In summer 2016 you scheduled an event in turkey for 14:00 on the 25th of December 2016.
151
168
With the information known in summer 2016 you would calculate that that is 12:00 UTC. What you couldn't imagine is,
@@ -161,12 +178,6 @@ and using the existing timezone information. And as there have been requests to
161
178
concern your current conversion from local time to UTC. So to avoid confusion is to avoid transposing between timezones
162
179
as much as possible and save it to the last possible moment.
163
180
164
- ` now() ` should be considered to be the equivalent of checking your wallclock at home or your wristwatch. It usually
165
- gives you the current point in time at your current location. And from that point you can then – if you
166
- need to – transpose to other timezones. That makes life much easier than setting your wallclock to UTC and
167
- having to transpose every time you want to communicate with someone.
168
181
169
- As this interface is a generic interface it can not impose a certain usecase and therefore needs to be as open
170
- as possible. That means to allow people to use any DateTimeImmutable object possible. And that also means to
171
- make sure users understand the consequence of that. Which is that it is the users requirement to make sure the
172
- returned DateTimeImmutable object conforms to their requirements.
182
+
183
+
0 commit comments