Skip to content

Conversation

@drdzyk
Copy link
Contributor

@drdzyk drdzyk commented Aug 31, 2022

This PR adds some functionality of php DateTime class. Namelly, the following functions:


class DateTime {
  /** @kphp-extern-func-info can_throw */
  public function __construct(string $datetime = "now", ?DateTimeZone $timezone = null);
  public static function createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): ?DateTime;
  public static function getLastErrors(): array|false;
  public function modify(string $modifier): ?DateTime;
  public function setDate(int $year, int $month, int $day): DateTime;
  public function setISODate(int $year, int $week, int $dayOfWeek = 1): DateTime;
  public function setTime(
      int $hour,
      int $minute,
      int $second = 0,
      int $microsecond = 0
  ): DateTime;
  public function setTimestamp(int $timestamp): DateTime;
  public function format(string $format): string;
  public function getOffset(): int;
  public function getTimestamp(): int;
}

@drdzyk drdzyk requested a review from quasilyte August 31, 2022 07:49
@tolk-vm tolk-vm added this to the next milestone Oct 5, 2022
@drdzyk drdzyk requested a review from quasilyte October 5, 2022 11:27
@tolk-vm tolk-vm added the missing functionality Missing PHP functions, classes, constants and etc label Oct 5, 2022
@tolk-vm tolk-vm merged commit 72b20ad into master Oct 5, 2022
@tolk-vm tolk-vm deleted the seismont/date-time-class branch October 5, 2022 16:11
@drdzyk drdzyk mentioned this pull request Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing functionality Missing PHP functions, classes, constants and etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants