88
99For handling points in civil time, a C<DateTime> object stores year, month,
1010day, hour, minute (all L<C<Int>|/type/Int>), second (potentially fractional) and
11- a time zone .
11+ a timezone .
1212
1313It provides methods for calculating with date (for the Gregorian calendar) and time.
1414
1515C<DateTime> methods are immutable; if you are tempted to modify one, create a
1616modified copy instead.
1717
18- Time zones are handled as L<C<Int>|/type/Int>s in B<seconds> offset from UTC,
19- not by time zone name.
18+ Timezones are handled as L<C<Int>|/type/Int>s in B<seconds> offset from UTC,
19+ not by timezone name.
2020
2121=begin code
2222my $dt = DateTime.new(
@@ -61,7 +61,7 @@ Creates a new C<DateTime> object. One option for creating a new C<DateTime> obje
6161is from the components (year, month, day, hour, ...) separately. Another is to
6262pass a L<C<Date>|/type/Date> object for the date component, and specify the time
6363component-wise. Yet another is to obtain the time from an
64- L<C<Instant>|/type/Instant>, and only supply the time zone and formatter. Or
64+ L<C<Instant>|/type/Instant>, and only supply the timezone and formatter. Or
6565instead of an L<C<Instant>|/type/Instant> you can supply a L<C<Numeric>|/type/Numeric> as a Unix timestamp
6666(but note that this last method provides no way to disambiguate leap seconds,
6767unlike using L<C<Instant>|/type/Instant>).
@@ -74,8 +74,8 @@ ISO 8601 standard, as we allow Unicode digits and mixing of condensed
7474and extended time formats.
7575
7676An invalid input string throws an exception of type
77- L<C<X::Temporal::InvalidFormat>|/type/X::Temporal::InvalidFormat>. If you supply a string that includes a time
78- zone and supply the C<timezone> named argument, an exception of type
77+ L<C<X::Temporal::InvalidFormat>|/type/X::Temporal::InvalidFormat>. If you supply a string that includes a
78+ timezone and supply the C<timezone> named argument, an exception of type
7979L<C<X::DateTime::TimezoneClash>|/type/X::DateTime::TimezoneClash> is thrown.
8080
8181 my $datetime = DateTime.new(year => 2015,
@@ -91,7 +91,7 @@ L<C<X::DateTime::TimezoneClash>|/type/X::DateTime::TimezoneClash> is thrown.
9191 second => 1,
9292 timezone => 1);
9393 $datetime = DateTime.new(2015, 1, 1, # First January of 2015
94- 1, 1, 1); # Hour, minute, second with default time zone
94+ 1, 1, 1); # Hour, minute, second with default timezone
9595 $datetime = DateTime.new(now); # Instant.
9696 # from a Unix timestamp
9797 say $datetime = DateTime.new(1470853583.3); # OUTPUT: «2016-08-10T18:26:23.300000Z»
@@ -185,15 +185,15 @@ Returns the second component, rounded down to an L<C<Int>|/type/Int>.
185185
186186 method timezone(DateTime:D: --> Int:D)
187187
188- Returns the time zone B<in seconds> as an offset from UTC.
188+ Returns the timezone B<in seconds> as an offset from UTC.
189189
190190 say DateTime.new('2015-12-24T12:23:00+0200').timezone; # OUTPUT: «7200»
191191
192192=head2 method offset
193193
194194 method offset(DateTime:D: --> Int:D)
195195
196- Returns the time zone B<in seconds> as an offset from UTC. This is an alias for
196+ Returns the timezone B<in seconds> as an offset from UTC. This is an alias for
197197L<method timezone|#method timezone>.
198198
199199 say DateTime.new('2015-12-24T12:23:00+0200').offset; # OUTPUT: «7200»
@@ -202,15 +202,15 @@ L<method timezone|#method timezone>.
202202
203203 method offset-in-minutes(DateTime:D: --> Real:D)
204204
205- Returns the time zone in minutes as an offset from UTC.
205+ Returns the timezone in minutes as an offset from UTC.
206206
207207 say DateTime.new('2015-12-24T12:23:00+0200').offset-in-minutes; # OUTPUT: «120»
208208
209209=head2 method offset-in-hours
210210
211211 method offset-in-hours(DateTime:D: --> Real:D)
212212
213- Returns the time zone in hours as an offset from UTC.
213+ Returns the timezone in hours as an offset from UTC.
214214
215215=for code
216216say DateTime.new('2015-12-24T12:23:00+0200').offset-in-hours; # OUTPUT: «2»
@@ -323,7 +323,7 @@ Returns the date and time as a POSIX/Unix timestamp (non-leap seconds since the
3233231970-01-01T00:00:00Z).
324324
325325If C<$ignore-timezone> is C<True>, the C<DateTime> object will be treated as if
326- the time zone offset is zero.
326+ the timezone offset is zero.
327327
328328 method posix(Bool:D: $ignore-timezone = False, :$real --> Num:D)
329329
@@ -386,7 +386,7 @@ Returns the invocant.
386386
387387 method utc(DateTime:D: --> DateTime:D)
388388
389- Returns a DateTime object for the same time, but in time zone UTC.
389+ Returns a DateTime object for the same time, but in timezone UTC.
390390
391391 say DateTime.new('2015-12-24T12:23:00+0200').utc;
392392 # OUTPUT: «2015-12-24T10:23:00Z»
@@ -411,7 +411,7 @@ not respect local time and always occur at the end of the I<UTC> day:
411411
412412 method local(DateTime:D: --> DateTime:D)
413413
414- Returns a DateTime object for the same time, but in the local time zone
414+ Returns a DateTime object for the same time, but in the local timezone
415415(L«C<$*TZ>|/language/variables#index-entry-%24*TZ»).
416416
417417 my $*TZ = -3600;
@@ -425,7 +425,7 @@ Returns a DateTime object for the same time, but in the local time zone
425425Takes a C<DateTime> to subtract from and either a
426426L«C<Duration>|/type/Duration» or another C<DateTime> object. Returns a new
427427C<DateTime> object or the L<C<Duration>|/type/Duration> between the two dates, respectively. When
428- subtracting L<C<Duration>|/type/Duration>, time zone of the original C<DateTime> is preserved
428+ subtracting L<C<Duration>|/type/Duration>, timezone of the original C<DateTime> is preserved
429429in the returned C<DateTime> object.
430430
431431 say raku DateTime.new(:2016year) - DateTime.new(:2015year):;
@@ -439,7 +439,7 @@ in the returned C<DateTime> object.
439439 multi infix:<+> (Duration:D, DateTime:D --> DateTime:D)
440440
441441Takes a C<DateTime> and increases it by the given
442- L«C<Duration>|/type/Duration», preserving the time zone .
442+ L«C<Duration>|/type/Duration», preserving the timezone .
443443
444444 say DateTime.new(:2015year) + Duration.new(31536001.0);
445445 # OUTPUT: «2016-01-01T00:00:00Z»
0 commit comments