mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #23834
[Bug 1414628] [NEW] strptime on OS X always returns 0 for tm_wday and tm_yday
Public bug reported:
As mentioned in this 5-year old comment on the php documentation page
http://php.net/manual/en/function.strptime.php#89239 , tm_wday and
tm_yday are not initialized on BSD-based systems.
This is apparently still true, at least on OS X. I'm running PHP
5.5.20, and these values are always set to 0.
htdocs/view/access.php in Mahara 1.10.2 uses tm_wday in the
ptimetotime() function.
I propose that this method be updated to not use tm_wday, since it
doesn't need to.
```
diff --git a/htdocs/view/access.php b/htdocs/view/access.php
index 26ea7d3..299bf89 100644
--- a/htdocs/view/access.php
+++ b/htdocs/view/access.php
@@ -336,8 +336,8 @@ function ptimetotime($ptime) {
$ptime['tm_hour'],
$ptime['tm_min'],
$ptime['tm_sec'],
- 1,
- $ptime['tm_yday'] + 1,
+ $ptime['tm_mon'] + 1,
+ $ptime['tm_mday'],
$ptime['tm_year'] + 1900
);
}
```
** Affects: mahara
Importance: Undecided
Status: New
** Tags: osx
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1414628
Title:
strptime on OS X always returns 0 for tm_wday and tm_yday
Status in Mahara ePortfolio:
New
Bug description:
As mentioned in this 5-year old comment on the php documentation page
http://php.net/manual/en/function.strptime.php#89239 , tm_wday and
tm_yday are not initialized on BSD-based systems.
This is apparently still true, at least on OS X. I'm running PHP
5.5.20, and these values are always set to 0.
htdocs/view/access.php in Mahara 1.10.2 uses tm_wday in the
ptimetotime() function.
I propose that this method be updated to not use tm_wday, since it
doesn't need to.
```
diff --git a/htdocs/view/access.php b/htdocs/view/access.php
index 26ea7d3..299bf89 100644
--- a/htdocs/view/access.php
+++ b/htdocs/view/access.php
@@ -336,8 +336,8 @@ function ptimetotime($ptime) {
$ptime['tm_hour'],
$ptime['tm_min'],
$ptime['tm_sec'],
- 1,
- $ptime['tm_yday'] + 1,
+ $ptime['tm_mon'] + 1,
+ $ptime['tm_mday'],
$ptime['tm_year'] + 1900
);
}
```
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1414628/+subscriptions
Follow ups
-
[Bug 1414628] Re: strptime on OS X always returns 0 for tm_wday and tm_yday
From: Aaron Wells, 2015-04-20
-
[Bug 1414628] A change has been merged
From: Mahara Bot, 2015-04-20
-
[Bug 1414628] A patch has been submitted for review
From: Mahara Bot, 2015-04-20
-
[Bug 1414628] Re: strptime on OS X always returns 0 for tm_wday and tm_yday
From: Aaron Wells, 2015-04-20
-
[Bug 1414628] Re: strptime on OS X always returns 0 for tm_wday and tm_yday
From: Son Nguyen, 2015-04-19
-
[Bug 1414628] Re: strptime on OS X always returns 0 for tm_wday and tm_yday
From: Robert Lyon, 2015-04-17
-
[Bug 1414628] A change has been merged
From: Mahara Bot, 2015-02-16
-
[Bug 1414628] Re: strptime on OS X always returns 0 for tm_wday and tm_yday
From: Robert Lyon, 2015-02-16
-
[Bug 1414628] A patch has been submitted for review
From: Mahara Bot, 2015-02-15
-
[Bug 1414628] A change has been merged
From: Mahara Bot, 2015-02-15
-
[Bug 1414628] Re: strptime on OS X always returns 0 for tm_wday and tm_yday
From: Robert Lyon, 2015-02-15
-
[Bug 1414628] Re: strptime on OS X always returns 0 for tm_wday and tm_yday
From: Aaron Wells, 2015-02-13
-
[Bug 1414628] A patch has been submitted for review
From: Mahara Bot, 2015-02-13
-
[Bug 1414628] Re: strptime on OS X always returns 0 for tm_wday and tm_yday
From: Aaron Wells, 2015-02-13
-
[Bug 1414628] [NEW] strptime on OS X always returns 0 for tm_wday and tm_yday
From: Brian King, 2015-01-26
References