Sets default date time value

@param object $oObject          date field object
@param string $sLocalDateFormat input format
@param string $sLocalTimeFormat local format
@param bool   $blOnlyDate       marker to format only date field (no time)
963986
protected function _setDefaultDateTimeValue($oObject, $sLocalDateFormat, $sLocalTimeFormat, $blOnlyDate)
    {
        $aDFormats = $this->_defineDateFormattingRules();
        $aTFormats = $this->_defineTimeFormattingRules();

        $sReturn = $aDFormats[$sLocalDateFormat][2];
        if (!$blOnlyDate) {
            $sReturn .= " " . $aTFormats[$sLocalTimeFormat][2];
        }

        if ($oObject instanceof \OxidEsales\Eshop\Core\Field) {
            $oObject->setValue(trim($sReturn));
        } else {
            $oObject->value = trim($sReturn);
        }
        // increasing(decreasing) field lenght
        $oObject->fldmax_length = strlen($oObject->value);
    }
654929
@Override
  public void format(ZonedDateTime datetime, CalendarFormatOptions options, StringBuilder buffer) {
    String dateSkeleton = options.dateSkeleton() == null ? null : options.dateSkeleton().skeleton();
    String timeSkeleton = options.timeSkeleton() == null ? null : options.timeSkeleton().skeleton();

    CalendarFormat wrapperFormat = options.wrapperFormat();
    CalendarFormat dateFormat = options.dateFormat();
    CalendarFormat timeFormat = options.timeFormat();
    if (wrapperFormat != null) {
      // If wrapper is set it implies we want to output both a date and a time. If either is unset
      // we need to set it to the wrapper's format, unless a skeleton is defined.
      dateFormat = dateFormat != null ? dateFormat : (dateSkeleton == null ? wrapperFormat : null);
      timeFormat = timeFormat != null ? timeFormat : (timeSkeleton == null ? wrapperFormat : null);
    } else {
      // If wrapper is null, attempt to default it using the date's format or SHORT.
      if ((dateFormat != null || dateSkeleton != null) && (timeFormat != null || timeSkeleton != null)) {
        wrapperFormat = dateFormat != null ? dateFormat : CalendarFormat.SHORT;
      }
    }

    if (wrapperFormat != null) {
      formatWrapped(wrapperFormat, dateFormat, timeFormat, dateSkeleton, timeSkeleton, datetime, buffer);
      
    } else if (options.dateFormat() != null) {
      formatDate(options.dateFormat(), datetime, buffer);

    } else if (options.timeFormat() != null) {
      formatTime(options.timeFormat(), datetime, buffer);
    
    } else {
      String skeleton = dateSkeleton != null ? dateSkeleton : timeSkeleton;

      // If every property is null, fall back to this default "yMd"
      if (skeleton == null) {
        skeleton = CalendarSkeleton.yMd.skeleton();
      }
      formatSkeleton(skeleton, datetime, buffer);
    }
  }
589163
public static function timeFormat(
        $timestamp,
        $date_only = false,
        $date_format = null,
        $time_format = null,
        $time_only = false,
        $no_text = false
    ) {

        if ($timestamp == '') {
            return __('Never');
        }

        $diff = (User::get()->timezone + User::get()->dst) * 3600;
        $timestamp += $diff;
        $now = time();

        if (is_null($date_format)) {
            $date_format = Container::get('forum_date_formats')[User::get()->date_format];
        }

        if (is_null($time_format)) {
            $time_format = Container::get('forum_time_formats')[User::get()->time_format];
        }

        $date = gmdate($date_format, $timestamp);
        $today = gmdate($date_format, $now + $diff);
        $yesterday = gmdate($date_format, $now + $diff - 86400);

        if (!$no_text) {
            if ($date == $today) {
                $date = __('Today');
            } elseif ($date == $yesterday) {
                $date = __('Yesterday');
            }
        }

        if ($date_only) {
            return $date;
        } elseif ($time_only) {
            return gmdate($time_format, $timestamp);
        } else {
            return $date . ' ' . gmdate($time_format, $timestamp);
        }
    }
200144
public function setCreatedAt($createdAt)
    {
        if ($createdAt instanceof \DateTime
            || (is_object($createdAt) && method_exists($createdAt, 'format'))) {
            $this->createdAt = $createdAt->format('Y-m-d H:i:s');
        } else {
            $this->createdAt = $createdAt;
        }
    }
906318
function(oData) {
    var date = null;
    
    //Convert to date
    if(!(oData instanceof Date)) {
        date = new Date(oData);
    }
    else {
        return oData;
    }
    
    // Validate
    if(date instanceof Date) {
        return date;
    }
    else {
        YAHOO.log("Could not convert data " + lang.dump(oData) + " to type Date", "warn", this.toString());
        return null;
    }
}
1159668
public static function setExcelCalendar($baseDate)
    {
        if (($baseDate == self::CALENDAR_WINDOWS_1900) ||
            ($baseDate == self::CALENDAR_MAC_1904)) {
            self::$excelBaseDate = $baseDate;
            return true;
        }
        return false;
    }
1276793
private DateTime parseToDate(String toDate) {
        // Default to now
        return parseDate(toDate, new DateTime().withZone(DateTimeZone.UTC), false);
    }
189146
static function mysqlToDateTime($mysqlDate = false)
    {
        return static::createFromFormat(static::$mysqlFormat, $mysqlDate)->format(Settings\DefaultDateSettings::$defaultDateTimeFromat);
    }
29046
void formatTimeZone_O(StringBuilder b, ZonedDateTime d, int width) {
    int[] tz = getTzComponents(d);
    switch (width) {
      case 1:
        wrapTimeZoneGMT(b, tz[TZNEG] == -1, tz[TZHOURS], tz[TZMINS], true);
        break;
        
      case 4:
        wrapTimeZoneGMT(b, tz[TZNEG] == -1, tz[TZHOURS], tz[TZMINS], false);
        break;
    }
  }
1004167
function parseAndCheck(oDateFormat, sValue) {
			var oDate = oDateFormat.parse(sValue);
			if (!oDate) {
				throw new Error("Not a valid " + oPropertyMetadata.$Type + " value: " + sValue);
			}
			return oDate;
		}
668362
public static function formatDate($date, $fromFormat='d-m-Y', $toFormat='Y-m-d')
    {   
        $dt = \DateTime::createFromFormat($fromFormat, $date);
        return !$dt ? null : $dt->format($toFormat);
    }
578047
public synchronized static String formatDate(final java.util.Date object, String pattern) {
		if (pattern == null || pattern.equals("")) {
			pattern = JKFormatUtil.DEFAULT_DATE_PATTERN;
		}
		return JKFormatUtil.getDateFormatter(pattern).format(object);
	}
926240
public void setDateWithDefaultZone(java.util.Date javaUtilDate) {
        if (javaUtilDate == null) {
            parentDatePicker.setDate(null);
            return;
        }
        Instant instant = Instant.ofEpochMilli(javaUtilDate.getTime());
        ZonedDateTime zonedDateTime = instant.atZone(ZoneId.systemDefault());
        LocalDate localDate = zonedDateTime.toLocalDate();
        parentDatePicker.setDate(localDate);
    }
698545
function defaultFormatDate(date, timezone) {
        if (!date) {
          return '';
        }

        // All of the dates created through ng-material *should* be set to midnight.
        // If we encounter a date where the localeTime shows at 11pm instead of midnight,
        // we have run into an issue with DST where we need to increment the hour by one:
        // var d = new Date(1992, 9, 8, 0, 0, 0);
        // d.toLocaleString(); // == "10/7/1992, 11:00:00 PM"
        var localeTime = date.toLocaleTimeString();
        var formatDate = date;
        if (date.getHours() === 0 &&
            (localeTime.indexOf('11:') !== -1 || localeTime.indexOf('23:') !== -1)) {
          formatDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 1, 0, 0);
        }

        return $filter('date')(formatDate, 'M/d/yyyy', timezone);
      }
738372
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
    {
        if ( $currentVersion != false )
        {
            $dataInt = $originalContentObjectAttribute->attribute( "data_int" );
            $contentObjectAttribute->setAttribute( "data_int", $dataInt );
        }
        else
        {
            $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
            $defaultType = $contentClassAttribute->attribute( self::DEFAULT_FIELD );
            if ( $defaultType == self::DEFAULT_CURRENT_DATE )
            {
                $contentObjectAttribute->setAttribute( "data_int", time() );
            }
            else if ( $defaultType == self::DEFAULT_ADJUSTMENT )
            {
                $adjustments = $this->classAttributeContent( $contentClassAttribute );
                $value = new eZDateTime();
                $secondAdjustment = $contentClassAttribute->attribute( self::USE_SECONDS_FIELD ) == 1 ? $adjustments['second'] : 0;
                $value->adjustDateTime( $adjustments['hour'], $adjustments['minute'], $secondAdjustment, $adjustments['month'], $adjustments['day'], $adjustments['year'] );
                $contentObjectAttribute->setAttribute( "data_int", $value->timeStamp() );
            }
            else
                $contentObjectAttribute->setAttribute( "data_int", null );
        }
    }
1135604
protected function _setDate($oObject, $sDateFormat, $aDFields, $aDateMatches)
    {
        // formatting correct time value
        $iTimestamp = mktime(
            0,
            0,
            0,
            $aDateMatches[$aDFields[0]],
            $aDateMatches[$aDFields[1]],
            $aDateMatches[$aDFields[2]]
        );

        if ($oObject instanceof \OxidEsales\Eshop\Core\Field) {
            $oObject->setValue(@date($sDateFormat, $iTimestamp));
        } else {
            $oObject->value = @date($sDateFormat, $iTimestamp);
        }
        // we should increase (decrease) field lenght
        $oObject->fldmax_length = strlen($oObject->value);
    }
759497
public int setCalendar(Calendar value, boolean bDisplayOption, int iMoveMode)
    {           // Set this field's value
        java.util.Date dateTemp = value.getTime();
        int errorCode = this.setData(dateTemp, bDisplayOption, iMoveMode);
        return errorCode;
    }