Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZCiCal::toUnixDateTime - missing return statement #11

Open
tomas-eklund opened this issue Jan 29, 2019 · 0 comments
Open

ZCiCal::toUnixDateTime - missing return statement #11

tomas-eklund opened this issue Jan 29, 2019 · 0 comments

Comments

@tomas-eklund
Copy link

The ZCiCal::toUnixDateTime() does not return anything.

/**
 * Read date/time in iCal formatted string
 *
 * @param string iCal formated date/time string
 *
 * @return int Unix timestamp
 * @deprecated Use ZDateHelper::toUnixDateTime() instead
 */

function toUnixDateTime($datetime){
	$year = substr($datetime,0,4);
	$month = substr($datetime,4,2);
	$day = substr($datetime,6,2);
	$hour = 0;
	$minute = 0;
	$second = 0;
	if(strlen($datetime) > 8 && $datetime{8} == "T") {
		$hour = substr($datetime,9,2);
		$minute = substr($datetime,11,2);
		$second = substr($datetime,13,2);
	}
	$d1 = mktime($hour, $minute, $second, $month, $day, $year);

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant