Subversion-Projekte lars-tiefland.ci

Revision

Revision 1257 | Revision 2242 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 1257 Revision 2049
Zeile 4... Zeile 4...
4
 *
4
 *
5
 * An open source application development framework for PHP
5
 * An open source application development framework for PHP
6
 *
6
 *
7
 * This content is released under the MIT License (MIT)
7
 * This content is released under the MIT License (MIT)
8
 *
8
 *
9
 * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
9
 * Copyright (c) 2014 - 2017, British Columbia Institute of Technology
10
 *
10
 *
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
12
 * of this software and associated documentation files (the "Software"), to deal
12
 * of this software and associated documentation files (the "Software"), to deal
13
 * in the Software without restriction, including without limitation the rights
13
 * in the Software without restriction, including without limitation the rights
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Zeile 27... Zeile 27...
27
 * THE SOFTWARE.
27
 * THE SOFTWARE.
28
 *
28
 *
29
 * @package	CodeIgniter
29
 * @package	CodeIgniter
30
 * @author	EllisLab Dev Team
30
 * @author	EllisLab Dev Team
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
32
 * @copyright	Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
32
 * @copyright	Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
33
 * @license	http://opensource.org/licenses/MIT	MIT License
33
 * @license	http://opensource.org/licenses/MIT	MIT License
34
 * @link	https://codeigniter.com
34
 * @link	https://codeigniter.com
35
 * @since	Version 1.0.0
35
 * @since	Version 1.0.0
36
 * @filesource
36
 * @filesource
37
 */
37
 */
Zeile 494... Zeile 494...
494
{
494
{
495
	/**
495
	/**
496
	 * Turns many "reasonably-date-like" strings into something
496
	 * Turns many "reasonably-date-like" strings into something
497
	 * that is actually useful. This only works for dates after unix epoch.
497
	 * that is actually useful. This only works for dates after unix epoch.
498
	 *
498
	 *
-
 
499
	 * @deprecated	3.1.3	Use DateTime::createFromFormat($input_format, $input)->format($output_format);
499
	 * @param	string	The terribly formatted date-like string
500
	 * @param	string	The terribly formatted date-like string
500
	 * @param	string	Date format to return (same as php date function)
501
	 * @param	string	Date format to return (same as php date function)
501
	 * @return	string
502
	 * @return	string
502
	 */
503
	 */
503
	function nice_date($bad_date = '', $format = FALSE)
504
	function nice_date($bad_date = '', $format = FALSE)
Zeile 527... Zeile 528...
527
 
528
 
528
			return date($format, strtotime($year.'-'.$month.'-01'));
529
			return date($format, strtotime($year.'-'.$month.'-01'));
Zeile 529... Zeile 530...
529
		}
530
		}
530
 
531
 
531
		// Date Like: YYYYMMDD
532
		// Date Like: YYYYMMDD
532
		if (preg_match('/^(\d{2})\d{2}(\d{4})$/i', $bad_date, $matches))
533
		if (preg_match('/^\d{8}$/i', $bad_date, $matches))
533
		{
534
		{
Zeile 534... Zeile 535...
534
			return date($format, strtotime($matches[1].'/01/'.$matches[2]));
535
			return DateTime::createFromFormat('Ymd', $bad_date)->format($format);
535
		}
536
		}
536
 
537