txt: ## new.md
  ## Chunk 2 of 2
  0, :&formatter)
  multi method new(Numeric:D $posix,  :$timezone=0, :&formatter)
  multi method new(Str:D $format, :$timezone=0, :&formatter)
  
  ```
  
  Creates a new `DateTime` object. One option for creating a new DateTime object is from the components (year, month, day, hour, ...) separately. Another is to pass a [`Date`](/type/Date) object for the date component, and specify the time component-wise. Yet another is to obtain the time from an [`Instant`](/type/Instant), and only supply the time zone and formatter. Or instead of an Instant you can supply a [`Numeric`](/type/Numeric) as a UNIX timestamp.
  
  You can also supply a [`Str`](/type/Str) formatted in ISO 8601 timestamp notation or as a full [RFC 3339](https://tools.ietf.org/html/rfc3339) date and time. Strings should be formatted as `yyyy-mm-ddThh:mm:ssZ` or `yyyy-mm-ddThh:mm:ss+0100`. We are somewhat less restrictive than the ISO 8601 standard, as we allow Unicode digits and mixing of condensed and extended time formats.
  
  An invalid input string throws an exception of type [`X::Temporal::InvalidFormat`](/type/X/Temporal/InvalidFormat). If you supply a string that includes a time zone and supply the `timezone` named argument, an exception of type [`X::DateTime::TimezoneClash`](/type/X/DateTime/TimezoneClash) is thrown.
  
  ```raku
  my $datetime = DateTime.new(year => 2015,
                              month => 1,
                              day => 1,
                              hour => 1,
                              minute => 1,
                              second => 1,
                              timezone => 1);
  $datetime = DateTime.new(date => Date.new('2015-12-24'),
                           hour => 1,
                           minute => 1,
                           second => 1,
                           timezone => 1);
  $datetime = DateTime.new(2015, 1, 1, # First January of 2015
                           1, 1, 1);   # Hour, minute, second with default time zone
  $datetime = DateTime.new(now);                       # Instant.
  # from a Unix timestamp
  say $datetime = DateTime.new(1470853583.3);          # OUTPUT: «2016-08-10T18:26:23.300000Z␤»
  $datetime = DateTime.new("2015-01-01T03:17:30+0500") # Formatted string
  ```
  
  Since Rakudo release 2022.03, the `day` parameter can be a [`Callable`](/type/Callable), with `*` returning the last day in the month, and `*-n` returning the last but `n`.
  
  Since Rakudo release 2022.07, it is also possible to just specify a "YYYY-MM-DD" string to indicate midnight on the given date.
  
  ```raku
  say DateTime.new("2023-03-04");  # OUTPUT: «2023-03-04T00:00:00Z␤»
  ```
  
  # [In IO::Path::QNX](#___top "go to top of document")[§](#(IO::Path::QNX)_method_new "direct link")
  
  See primary documentation
  [in context](/type/IO/Path/QNX#method_new)
  for **method new**.
  
  Same as [`IO::Path.new`](/type/IO/Path#method_new), except `:$SPEC` cannot be set and defaults to [`IO::Spec::QNX`](/type/IO/Spec/QNX), regardless of the operating system the code is being run on.
  
  # [In Formatter](#___top "go to top of document")[§](#(Formatter)_method_new "direct link")
  
  See primary documentation
  [in context](/type/Formatter#method_new)
  for **method new**.
  
  ```raku
  method new($format --> Callable:D)
  ```
  
  Returns a cached [`Callable`](/type/Callable) object from a `sprintf` compatible format string. Will create a new [`Callable`](/type/Callable) object if the given format string had not been seen before.
  
  ```raku
  use v6.e.PREVIEW;
  my &zero5 = Formatter.new("%05d");
  say zero5(42);                  # OUTPUT: «00042␤»
  
  ```
  
  # [In ComplexStr](#___top "go to top of document")[§](#(ComplexStr)_method_new "direct link")
  
  See primary documentation
  [in context](/type/ComplexStr#method_new)
  for **method new**.
  
  ```raku
  method new(Complex $i, Str $s)
  ```
  
  The constructor requires both the [`Complex`](/type/Complex) and the [`Str`](/type/Str) value, when constructing one directly the values can be whatever is required:
  
  ```raku
  my $f = ComplexStr.new(42+0i, "forty two (but complicated)");
  say +$f; # OUTPUT: «42+0i␤»
  say ~$f; # OUTPUT: «"forty two (but complicated)"␤»
  ```
  
  # [In Semaphore](#___top "go to top of document")[§](#(Semaphore)_method_new "direct link")
  
  See primary documentation
  [in context](/type/Semaphore#method_new)
  for **method new**.
  
  ```raku
  method new( int $permits )
  ```
  
  Initialize the semaphore with the number of permitted accesses. E.g. when set to 2, program threads can pass the acquire method twice until it blocks on the third time acquire is called.
  
  # [In Supplier](#___top "go to top of document")[§](#(Supplier)_method_new "direct link")
  
  See primary documentation
  [in context](/type/Supplier#method_new)
  for **method new**.
  
  ```raku
  method new()
  ```
  
  The `Supplier` constructor.
  
  # [In RatStr](#___top "go to top of document")[§](#(RatStr)_method_new "direct link")
  
  See primary documentation
  [in context](/type/RatStr#method_new)
  for **method new**.
  
  ```raku
  method new(Rat $i, Str $s)
  ```
  
  The constructor requires both the [`Rat`](/type/Rat) and the [`Str`](/type/Str) value, when constructing one directly the values can be whatever is required:
  
  ```raku
  my $f = RatStr.new(42.1, "forty two and a bit");
  say +$f; # OUTPUT: «42.1␤»
  say ~$f; # OUTPUT: «"forty two and a bit"␤»
  ```
  
  # [In RakuAST::Doc::Declarator](#___top "go to top of document")[§](#(RakuAST::Doc::Declarator)_method_new "direct link")
  
  See primary documentation
  [in context](/type/RakuAST/Doc/Declarator#method_new)
  for **method new**.
  
  ```raku
  method new(
    Str:D :$WHEREFORE,  # the associated RakuAST object
          :@leading,    # leading lines of documentation
          :@trailing    # trailing lines of documentation
  )
  
  ```
  
  The `new` method can be called to create a new `RakuAST::Doc::Declarator` object. It only takes named arguments.
  
  ```raku
  # there is no syntax for creating just a ::Declarator object
  
  my $declarator = RakuAST::Doc::Declarator.new(
    :WHEREFORE(RakuAST::VarDeclaration::Simple.new(...)),
    :leading("line 1 leading","line 2 leading"),
    :trailing("line 1 trailing","line 2 trailing")
  );
  
  ```
  
  Note that the leading and trailing documentation may contain any left margin whitespace.
  
  # [In Backtrace](#___top "go to top of document")[§](#(Backtrace)_method_new "direct link")
  
  See primary documentation
  [in context](/type/Backtrace#method_new)
  for **method new**.
  
  ```raku
  multi method new()
  multi method new(Int:D $offset)
  multi method new(Mu \ex)
  multi method new(Mu \ex, Int:D $offset)
  multi method new(List:D $bt)
  multi method new(List:D $bt, Int:D $offset)
  ```
  
  Creates a new backtrace, using its calling location as the origin of the backtrace or the `$offset` that is passed as a parameter. If an object or a list (that will already contain a backtrace in list form) is passed, they will be used instead of the current code.
  
  ```raku
  my $backtrace = Backtrace.new;
  ```
  
  # [In Date](#___top "go to top of document")[§](#(Date)_method_new "direct link")
  
  See primary documentation
  [in context](/type/Date#method_new)
  for **method new**.
  
  ```raku
  multi method new($year, $month, $day, :&formatter --> Date:D)
  multi method new(:$year!, :$month = 1, :$day = 1  --> Date:D)
  multi method new(Str $date                        --> Date:D)
  multi method new(Instant:D $dt                    --> Date:D)
  multi method new(DateTime:D $dt                   --> Date:D)
  ```
  
  Creates a new `Date` object, either from a triple of (year, month, day) that can be coerced to integers, or from a string of the form `YYYY-MM-DD` ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), or from an Instant or DateTime object. Optionally accepts a formatter as a named parameter.
  
  ```raku
  my $date = Date.new(2042, 1, 1);
  $date = Date.new(year => 2042, month => 1, day => 1);
  $date = Date.new("2042-01-01");
  $date = Date.new(Instant.from-posix: 1482155532);
  $date = Date.new(DateTime.now);
  ```
  
  Since Rakudo 2022.03, the "day" argument can also be a callable, with `*` representing the last day in a month, and the possibility of getting to the day counting from the last one:
  
  ```raku
  say Date.new(2042, 2, *); # OUTPUT: «2042-02-28␤»
  say Date.new(2044, 2, *); # OUTPUT: «2044-02-29␤»
  ```
  
  # [In role Rational](#___top "go to top of document")[§](#(role_Rational)_method_new "direct link")
  
  See primary documentation
  [in context](/type/Rational#method_new)
  for **method new**.
  
  ```raku
  method new(NuT:D $numerator, DeT:D $denominator --> Rational:D)
  
  ```
  
  Creates a new rational object from numerator and denominator, which it normalizes to the lowest terms. The `$denominator` can be zero, in which case the numerator is normalized to `-1`, `0`, or `1` depending on whether the original is negative, zero, or positive, respectively.
  