<commit_before><?php
/**
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @since         0.10.0
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */
namespace Cake\View\Helper;

use Cake\I18n\Time;
use Cake\View\Helper;
use Cake\View\Helper\StringTemplateTrait;

/**
 * Time Helper class for easy use of time data.
 *
 * Manipulation of time data.
 *
 * @link http://book.cakephp.org/3.0/en/core-libraries/helpers/time.html
 * @see \Cake\I18n\Time
 */
class TimeHelper extends Helper {

	use StringTemplateTrait;

/**
 * Returns a UNIX timestamp, given either a UNIX timestamp or a valid strtotime() date string.
 *
 * @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
 * @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
 * @return \Cake\I18n\Time
 */
	public function fromString($dateString, $timezone = null) {
		return (new Time($dateString))->timezone($timezone);
	}

/**
 * Returns a nicely formatted date string for given Datetime string.<commit_msg>Fix up mistake in timehelper docs link.<commit_after><?php
/**
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @since         0.10.0
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */
namespace Cake\View\Helper;

use Cake\I18n\Time;
use Cake\View\Helper;
use Cake\View\Helper\StringTemplateTrait;

/**
 * Time Helper class for easy use of time data.
 *
 * Manipulation of time data.
 *
 * @link http://book.cakephp.org/3.0/en/views/helpers/time.html
 * @see \Cake\I18n\Time
 */
class TimeHelper extends Helper {

	use StringTemplateTrait;

/**
 * Returns a UNIX timestamp, given either a UNIX timestamp or a valid strtotime() date string.
 *
 * @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
 * @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
 * @return \Cake\I18n\Time
 */
	public function fromString($dateString, $timezone = null) {
		return (new Time($dateString))->timezone($timezone);
	}

/**
 * Returns a nicely formatted date string for given Datetime string.
{'fraction_non_alphanumeric': 0.11608623548922056, 'fraction_numerical': 0.007960199004975124, 'mean_word_length': 3.8881685575364666, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5778260', 'n_tokens_mistral': 927, 'n_tokens_neox': 881, 'n_words': 287}