public static function dateTimeSql2PHP($sqlField,&$hasTime=false)
	{
		// 3  2016-01-31 00:00:00 -> 01/01/2016 00:00:00
		// mysql always returns the date/datetime/timestmamp in ansi format.
		if ($sqlField === "" || $sqlField===null) {
			if (DaoOne::$dateEpoch===null) return null;
			return DateTime::createFromFormat('Y-m-d H:i:s.u',DaoOne::$dateEpoch);
		}
		if (strpos($sqlField, '.')) {
			// with date with time and microseconds
			$hasTime=true;
			return DateTime::createFromFormat('Y-m-d H:i:s.u', $sqlField);
		} else {
			if (strpos($sqlField, ':')) {
				// date with time
				$hasTime=true;
				return DateTime::createFromFormat('Y-m-d H:i:s', $sqlField);
			} else {
				// only date
				$hasTime=false;
				return DateTime::createFromFormat('Y-m-d', $sqlField);
			}
		}
	}
public static function dateTimeSql2PHP($sqlField,&$hasTime=false)
	{
		// 3  2016-01-31 00:00:00 -> 01/01/2016 00:00:00
		// mysql always returns the date/datetime/timestmamp in ansi format.
		if ($sqlField === "" || $sqlField===null) {
			if (DaoOne::$dateEpoch===null) return null;
			return DateTime::createFromFormat('Y-m-d H:i:s.u',DaoOne::$dateEpoch);
		}
		if (strpos($sqlField, '.')) {
			// with date with time and microseconds
			$hasTime=true;
			return DateTime::createFromFormat('Y-m-d H:i:s.u', $sqlField);
		} else {
			if (strpos($sqlField, ':')) {
				// date with time
				$hasTime=true;
				return DateTime::createFromFormat('Y-m-d H:i:s', $sqlField);
			} else {
				// only date
				$hasTime=false;
				return DateTime::createFromFormat('Y-m-d', $sqlField);
			}
		}
	}
public static function dateTimeSql2PHP ( $ sqlField , & $ hasTime = false ) { // 3  2016-01-31 00:00:00 -> 01/01/2016 00:00:00 // mysql always returns the date/datetime/timestmamp in ansi format. if ( $ sqlField === "" || $ sqlField === null ) { if ( DaoOne :: $ dateEpoch === null ) return null ; return DateTime :: createFromFormat ( 'Y-m-d H:i:s.u' , DaoOne :: $ dateEpoch ) ; } if ( strpos ( $ sqlField , '.' ) ) { // with date with time and microseconds $ hasTime = true ; return DateTime :: createFromFormat ( 'Y-m-d H:i:s.u' , $ sqlField ) ; } else { if ( strpos ( $ sqlField , ':' ) ) { // date with time $ hasTime = true ; return DateTime :: createFromFormat ( 'Y-m-d H:i:s' , $ sqlField ) ; } else { // only date $ hasTime = false ; return DateTime :: createFromFormat ( 'Y-m-d' , $ sqlField ) ; } } }
Convert date, from mysql -> php
@param $sqlField
@param bool $hasTime
@return bool|DateTime|null
Convert date from mysql - > php