Converts a MySql formatted date to a default date time string
@param type $mysqlDate <p>Mysql date to convert</p>
@return string Default date time string
@see Settings\DefaultDateSettings
189146
static function mysqlToDateTime($mysqlDate = false)
    {
        return static::createFromFormat(static::$mysqlFormat, $mysqlDate)->format(Settings\DefaultDateSettings::$defaultDateTimeFromat);
    }
188018
public static function getDateSQLToForm($datetime)
    { 
        //YYYY-mm-dd
        $t = $this->splitDate($datetime, false);

        return $t['date'] . '/' . $t['month'] . '/' . $t['year'];
    }
1276793
private DateTime parseToDate(String toDate) {
        // Default to now
        return parseDate(toDate, new DateTime().withZone(DateTimeZone.UTC), false);
    }
526216
protected function formatDatetimeString($datetime, $format = null)
    {
        $format = $format ?: $this->format;

        if (!$datetime) {
            return null;
        }

        if ($datetime instanceof Carbon) {
            return $datetime->format($format);
        }

        return date($format, strtotime($datetime));
    }
502029
public function toMySQLDate($withTime = true)
    {
        if ($this->isHollow()) {
            return $withTime ? '0000-00-00 00:00:00' : '0000-00-00';
        }

        $format = $withTime ? 'Y-m-d H:i:s' : 'Y-m-d';

        return $this->format($format);
    }
501215
public static function getDateFormat($locale = null)
    {
        $format = Zend_Locale_Data::getContent($locale, 'date');
        if (empty($format)) {

            throw new Zend_Locale_Exception("failed to receive data from locale $locale");
        }

        return $format;
    }
326561
public function parseDateTime($rawValue) {
		if (null === $rawValue) {
			return null;
		}
		
		try {
			$dateTime = DateUtils::createDateTimeFromFormat(MysqlDateTimeColumn::FORMAT_DATE_TIME, $rawValue);
			if ($dateTime->getTimestamp() === false) {
				throw new DateParseException('Invalid datetime raw value: ' . $rawValue);
			}
			return $dateTime;
		} catch (\n2n\util\DateParseException $e) {
			throw new \InvalidArgumentException($e->getMessage(), 0, $e);
		}
	}
877934
protected function getDatetimeFormat()
    {
        if( $this->interval !== '* * * * *' )
        {
            $interval = $this->interval.' ';
        }
        else
        {
            $interval = ( $this->minute    ?? '*' ) . ' '.
                        ( $this->hour      ?? '*' ) . ' '.
                        ( $this->dayNumber ?? '*' ) . ' '.
                        ( $this->month     ?? '*' ) . ' '.
                        ( $this->day       ?? '*' ) . ' ';
        }

        $this->defaultIntervalVariables();

        return $interval;
    }
134020
public static function dateSql2Text($sqlField)
	{
		$hasTime=false;
		$tmpDate = self::dateTimeSql2PHP($sqlField,$hasTime);
		if ($tmpDate===null) return null;
		if ($hasTime) {
			return $tmpDate->format((strpos($sqlField,'.')!==false) ? self::$dateTimeMicroFormat : self::$dateTimeFormat);
		}  else {
			return $tmpDate->format(self::$dateFormat);
		}
	}
1281645
function DBTimeStamp($ts, $isfld = false)
	{

		if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
		if (is_object($ts)) $ds = $ts->format($this->fmtDate);
		else $ds = adodb_date($this->fmtTimeStamp,$ts);
		return 'TO_DATE('.$ds.",'RRRR-MM-DD, HH:MI:SS AM')";
	}
928224
protected function _defineAndCheckDefaultDateValues($blToTimeStamp)
    {
        // defining time format
        // checking for default values
        $sLocalDateFormat = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sLocalDateFormat');
        if (!$sLocalDateFormat || $blToTimeStamp) {
            $sLocalDateFormat = "ISO";
        }

        return $sLocalDateFormat;
    }
1075073
protected function formatDateTime(\DateTime $date = null, $format = null)
    {
        return $date && $format ?
            $date->format($format) :
            $date
        ;
    }
662770
public static function iCalDateToUnixTimestamp($icalDate)
    {
        $icalDate = str_replace('T', '', $icalDate);
        $icalDate = str_replace('Z', '', $icalDate);

        $pattern = '/([0-9]{4})';   // 1: YYYY
        $pattern .= '([0-9]{2})';    // 2: MM
        $pattern .= '([0-9]{2})';    // 3: DD
        $pattern .= '([0-9]{0,2})';  // 4: HH
        $pattern .= '([0-9]{0,2})';  // 5: MM
        $pattern .= '([0-9]{0,2})/'; // 6: SS
        preg_match($pattern, $icalDate, $date);

        // Unix timestamp can't represent dates before 1970
        if ($date[1] <= 1970) {
            return false;
        }
        // Unix timestamps after 03:14:07 UTC 2038-01-19 might cause an overflow
        // if 32 bit integers are used.
        $timestamp = mktime((int) $date[4], (int) $date[5], (int) $date[6], (int) $date[2], (int) $date[3], (int) $date[1]);

        return $timestamp;
    }
807604
protected function convertDateTime($rawValue)
    {
        if ($rawValue !== '') {
            $result = \DateTime::createFromFormat(\DateTime::W3C, $rawValue);
            $result->setTimezone(new \DateTimeZone(date_default_timezone_get()));

            return $result;
        }
    }
1134744
public static java.sql.Date getSqlDate(java.util.Date date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        return new java.sql.Date(cal.getTimeInMillis());
    }
692477
protected function extractDefault($defaultValue)
	{
		if($this->dbType==='timestamp' )
			$this->defaultValue=null;
		else
			parent::extractDefault(str_replace(array('(',')',"'"), '', $defaultValue));
	}
989613
protected function getDateAttribute($dateStr)
    {
        $format = "Y-m-d";
        if ($this->isType(['datetime', 'datetime-local'])) {
            $format .= '\TH:i:s';
        }

        return date($format, strtotime($dateStr));
    }