PluginProbe ʕ •ᴥ•ʔ
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin / 3.11.0
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin v3.11.0
4.9.0 0.9.6 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.6.0 1.6.2 1.7.0 1.7.1 1.8.0 1.8.1 1.9.0 2.0.0 2.0.1 2.1.1 2.2.1 2.3.1 2.4.0 2.5.0 2.5.1 2.6.0 2.7.0 2.8.0 2.9.0 3.0.1 3.0.2 3.0.3 3.1.0 3.10.0 3.11.0 3.11.1 3.2.0 3.2.1 3.3.0 3.4.0 3.5.0 3.5.1 3.5.2 3.6.1 3.7.0 3.8.0 3.8.2 3.9.0 4.0.1 4.1.0 4.1.1 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.8.0 trunk 0.10.0 0.10.1 0.11.1 0.11.2 0.3.1 0.3.2 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.5.2 0.6 0.7 0.8 0.8.2 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7 0.9.0 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5
wp-mail-smtp / vendor / woocommerce / action-scheduler / classes / ActionScheduler_DateTime.php
wp-mail-smtp / vendor / woocommerce / action-scheduler / classes Last commit date
WP_CLI 2 years ago abstracts 2 years ago actions 2 years ago data-stores 2 years ago migration 2 years ago schedules 2 years ago schema 2 years ago ActionScheduler_ActionClaim.php 2 years ago ActionScheduler_ActionFactory.php 2 years ago ActionScheduler_AdminView.php 2 years ago ActionScheduler_AsyncRequest_QueueRunner.php 2 years ago ActionScheduler_Compatibility.php 2 years ago ActionScheduler_DataController.php 2 years ago ActionScheduler_DateTime.php 2 years ago ActionScheduler_Exception.php 2 years ago ActionScheduler_FatalErrorMonitor.php 2 years ago ActionScheduler_InvalidActionException.php 2 years ago ActionScheduler_ListTable.php 2 years ago ActionScheduler_LogEntry.php 2 years ago ActionScheduler_NullLogEntry.php 2 years ago ActionScheduler_OptionLock.php 2 years ago ActionScheduler_QueueCleaner.php 2 years ago ActionScheduler_QueueRunner.php 2 years ago ActionScheduler_Versions.php 2 years ago ActionScheduler_WPCommentCleaner.php 2 years ago ActionScheduler_wcSystemStatus.php 2 years ago
ActionScheduler_DateTime.php
80 lines
1 <?php
2
3 /**
4 * ActionScheduler DateTime class.
5 *
6 * This is a custom extension to DateTime that
7 */
8 class ActionScheduler_DateTime extends DateTime {
9
10 /**
11 * UTC offset.
12 *
13 * Only used when a timezone is not set. When a timezone string is
14 * used, this will be set to 0.
15 *
16 * @var int
17 */
18 protected $utcOffset = 0;
19
20 /**
21 * Get the unix timestamp of the current object.
22 *
23 * Missing in PHP 5.2 so just here so it can be supported consistently.
24 *
25 * @return int
26 */
27 #[\ReturnTypeWillChange]
28 public function getTimestamp() {
29 return method_exists( 'DateTime', 'getTimestamp' ) ? parent::getTimestamp() : $this->format( 'U' );
30 }
31
32 /**
33 * Set the UTC offset.
34 *
35 * This represents a fixed offset instead of a timezone setting.
36 *
37 * @param $offset
38 */
39 public function setUtcOffset( $offset ) {
40 $this->utcOffset = intval( $offset );
41 }
42
43 /**
44 * Returns the timezone offset.
45 *
46 * @return int
47 * @link http://php.net/manual/en/datetime.getoffset.php
48 */
49 #[\ReturnTypeWillChange]
50 public function getOffset() {
51 return $this->utcOffset ? $this->utcOffset : parent::getOffset();
52 }
53
54 /**
55 * Set the TimeZone associated with the DateTime
56 *
57 * @param DateTimeZone $timezone
58 *
59 * @return static
60 * @link http://php.net/manual/en/datetime.settimezone.php
61 */
62 #[\ReturnTypeWillChange]
63 public function setTimezone( $timezone ) {
64 $this->utcOffset = 0;
65 parent::setTimezone( $timezone );
66
67 return $this;
68 }
69
70 /**
71 * Get the timestamp with the WordPress timezone offset added or subtracted.
72 *
73 * @since 3.0.0
74 * @return int
75 */
76 public function getOffsetTimestamp() {
77 return $this->getTimestamp() + $this->getOffset();
78 }
79 }
80