@@ -99,10 +99,12 @@ L<X::DateTime::TimezoneClash> is thrown.
99
99
100
100
Defined as:
101
101
102
- method now(:$timezone= $*TZ, :&formatter --> DateTime:D)
102
+ method now(:$timezone = $*TZ, :&formatter --> DateTime:D)
103
103
104
- Creates a new C < DateTime > object from the current system time, optionally with
105
- a different timezone than the default attached.
104
+ Creates a new C < DateTime > object from the current system time. A custom
105
+ L < formatter > and L < timezone > can be provided. The C < :$timezone > is
106
+ the offset B < in seconds > from L < GTM|https://en.wikipedia.org/wiki/Greenwich_Mean_Time >
107
+ and defaults to the value of L « C < $*TZ > variable|/language/variables#index-entry-%24*TZ» .
106
108
107
109
say DateTime.now;
108
110
@@ -183,7 +185,7 @@ Defined as:
183
185
184
186
method timezone(DateTime:D: --> Int:D)
185
187
186
- Returns the time zone in seconds as an offset from UTC.
188
+ Returns the time zone B < in seconds > as an offset from UTC.
187
189
188
190
say DateTime.new('2015-12-24T12:23:00+0200').timezone; # OUTPUT: «7200»
189
191
@@ -193,7 +195,7 @@ Defined as:
193
195
194
196
method offset(DateTime:D: --> Int:D)
195
197
196
- Returns the time zone in seconds as an offset from UTC. This is an alias for
198
+ Returns the time zone B < in seconds > as an offset from UTC. This is an alias for
197
199
L < #method timezone > .
198
200
199
201
say DateTime.new('2015-12-24T12:23:00+0200').offset; # OUTPUT: «7200»
@@ -353,7 +355,8 @@ Defined as:
353
355
354
356
method in-timezone(DateTime:D: $timezone = 0 --> DateTime:D)
355
357
356
- Returns a DateTime object for the same time, but in the specified time zone.
358
+ Returns a DateTime object for the same time, but in the specified C < $timezone > , which is
359
+ the offset B < in seconds > from L < GMT|https://en.wikipedia.org/wiki/Greenwich_Mean_Time > .
357
360
358
361
say DateTime.new('2015-12-24T12:23:00Z').in-timezone(3600 + 1800); # OUTPUT: «2015-12-24T13:53:00+0130»
359
362
@@ -364,7 +367,7 @@ Defined as:
364
367
method local(DateTime:D: --> DateTime:D)
365
368
366
369
Returns a DateTime object for the same time, but in the local time zone
367
- (C < $*TZ > ).
370
+ (L « C < $*TZ > |/language/variables#index-entry-%24*TZ » ).
368
371
369
372
my $*TZ = -3600;
370
373
say DateTime.new('2015-12-24T12:23:00+0200').local; # OUTPUT: «2015-12-24T09:23:00-0100»
0 commit comments