Date
extends Message
in package
Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`.
Generated from protobuf message google.type.Date
Table of Contents
Properties
- $day : mixed
- Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
- $month : mixed
- Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
- $year : mixed
- Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
Methods
- __construct() : mixed
- Constructor.
- getDay() : int
- Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
- getMonth() : int
- Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
- getYear() : int
- Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
- setDay() : $this
- Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
- setMonth() : $this
- Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
- setYear() : $this
- Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
Properties
$day
Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
protected
mixed
$day
= 0
Generated from protobuf field int32 day = 3 [json_name = "day"];
$month
Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
protected
mixed
$month
= 0
Generated from protobuf field int32 month = 2 [json_name = "month"];
$year
Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
protected
mixed
$year
= 0
Generated from protobuf field int32 year = 1 [json_name = "year"];
Methods
__construct()
Constructor.
public
__construct([array<string|int, mixed> $data = NULL ]) : mixed
Parameters
- $data : array<string|int, mixed> = NULL
-
{ Optional. Data for populating the Message object.
@type int $year Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. @type int $month Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. @type int $day Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.}
getDay()
Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
public
getDay() : int
Generated from protobuf field int32 day = 3 [json_name = "day"];
Return values
intgetMonth()
Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
public
getMonth() : int
Generated from protobuf field int32 month = 2 [json_name = "month"];
Return values
intgetYear()
Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
public
getYear() : int
Generated from protobuf field int32 year = 1 [json_name = "year"];
Return values
intsetDay()
Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
public
setDay(int $var) : $this
Generated from protobuf field int32 day = 3 [json_name = "day"];
Parameters
- $var : int
Return values
$thissetMonth()
Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
public
setMonth(int $var) : $this
Generated from protobuf field int32 month = 2 [json_name = "month"];
Parameters
- $var : int
Return values
$thissetYear()
Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
public
setYear(int $var) : $this
Generated from protobuf field int32 year = 1 [json_name = "year"];
Parameters
- $var : int