GhostManSec
Server: LiteSpeed
System: Linux premium197.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: parhudrw (1725)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/parhudrw/ve.anqa.it/wp-content/plugins/depicter/vendor/averta/core/src/Utility/Date.php
<?php
namespace Averta\Core\Utility;

class Date {

	/**
	 * Converts one date time format to another format
	 *
	 * @param string $dateTime
	 * @param string $toFormat
	 * @param string $fromFormat
	 * @param string $timeZone
	 *
	 * @return string
	 */
	public static function covertDateFormat( $dateTime, $toFormat = 'M d, Y H:i:s', $fromFormat = 'Y-m-d H:i:s', $timeZone = 'UTC' ){
		$dateTimeClass = \DateTime::createFromFormat(
			$fromFormat,
			$dateTime,
			new \DateTimeZone( $timeZone )
		);

		if ( $dateTimeClass === false ) {
			return $dateTime;
		}

		return $dateTimeClass->format( $toFormat );
	}
}