Generate the %d format for a date.

@return string
181701
protected function formatDayZeros(): string
    {
        if ($this->day > 9) {
            return I18N::digits($this->day);
        }

        return I18N::digits('0' . $this->day);
    }
880654
public static String format2ddMMMyy(Date date){
        SimpleDateFormat format = new SimpleDateFormat("ddMMMyy", Locale.ENGLISH);
        return format.format(date).toUpperCase();
    }
1226849
public String dateToString(D date) {
    try {
      return String.format(DATE_PATTERN,
          (Integer) PropertyUtils.getProperty(date, "year"),
          (Integer) PropertyUtils.getProperty(date, "month"),
          (Integer) PropertyUtils.getProperty(date, "day"));
    } catch (IllegalAccessException e) {
      throw new IllegalStateException("Could not access class.", e);
    } catch (InvocationTargetException e) {
      throw new IllegalStateException("Could not get field.", e);
    } catch (NoSuchMethodException e) {
      throw new IllegalStateException("Could not get field.", e);
    }
  }
1313123
public function getDataGeracao()
    {
        $data_geracao_str = $this->header->data_geracao;
        $format = strlen($data_geracao_str) > 6 ? 'dmY' : 'dmy';
        $format_printf = strlen($data_geracao_str) > 6 ? '%08d' : '%06d';

        return $data_geracao_str ? \DateTime::createFromFormat($format, sprintf($format_printf, $data_geracao_str)) : false;
    }
276899
public function getPHPDatePattern()
    {
        $isoFormat = Calendar::getDateFormat('short');
        $result = Calendar::tryConvertIsoToPhpFormat($isoFormat);
        if ($result === null) {
            $result = t(/*i18n: Short date format: see http://www.php.net/manual/en/function.date.php */ 'n/j/Y');
        }

        return $result;
    }
647884
public static String formatDateDifference(Date d1, Date d2) {
		long[] td = DateHelper.getTimeDifference(d1, d2);
		if (td[0] > 0) {
			return td[0] + " day(s), " + td[1] + " hour(s)";
		}
		if (td[1] > 0) {
			return td[1] + " hour(s), " + td[2] + " minute(s)";
		}
		if (td[2] > 0) {
			return td[2] + " minute(s), " + td[3] + " second(s)";
		}
		return td[3] + " second(s)";
	}
762189
public static function date($date){

		$Date = static::_utcZeroDateTime($date);

		if($Date === null){

			return $date;
		}

		return $Date->format('Y-m-d');
	}
1047297
public function toDateTime() : \DateTime
    {
        $second = $this->localDateTime->getSecond();

        // round down to the microsecond
        $nano = $this->localDateTime->getNano();
        $nano = 1000 * intdiv($nano, 1000);

        $dateTime = (string) $this->localDateTime->withNano($nano);
        $dateTimeZone = $this->timeZone->toDateTimeZone();

        $format = 'Y-m-d\TH:i';

        if ($second !== 0 || $nano !== 0) {
            $format .= ':s';

            if ($nano !== 0) {
                $format .= '.u';
            }
        }

        return \DateTime::createFromFormat($format, $dateTime, $dateTimeZone);
    }
1347112
protected function formatGedcomYear(): string
    {
        if ($this->year < 0) {
            return sprintf('%04d B.C.', -$this->year);
        }

        if ($this->new_old_style) {
            return sprintf('%04d/%02d', $this->year - 1, $this->year % 100);
        }

        return sprintf('%04d', $this->year);
    }
1274833
protected function formatDay(): string
    {
        $locale = app(LocaleInterface::class)->language()->code();

        if ($locale === 'he' || $locale === 'yi') {
            return (new JewishCalendar())->numberToHebrewNumerals($this->day, true);
        }

        return parent::formatDay();
    }
920524
public static function toDateString(Date $adManagerDate)
    {
        return sprintf(
            '%d-%02d-%02d',
            $adManagerDate->getYear(),
            $adManagerDate->getMonth(),
            $adManagerDate->getDay()
        );
    }
710002
public function getAllDateFormatFlat()
    {
        $aOut     = [];
        $aFormats = $this->getAllDateFormat();

        foreach ($aFormats as $oFormat) {
            $aOut[$oFormat->slug] = $oFormat->example;
        }

        return $aOut;
    }
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;
    }
792092
function formatDate( date ) {

	var dateString = '';

	date = new Date( date );

	dateString = date.getMonth() + 1;
	dateString += '/';
	dateString += date.getDate();
	dateString += '/';
	dateString += date.getFullYear();

	return dateString;
}
915934
public function dayOfWeek()
    {
        $dateString = sprintf(
            '%04d-%02d-%02d',
            $this->month->getYear()->value(),
            $this->month->value(),
            $this->day
        );

        $datetime = new \DateTime($dateString);

        return (int) $datetime->format('N');
    }
734661
public static function formatDate($date)
    {
        $format = DateTime::ATOM;
        if ($date instanceof DateTime) {
            $d = $date->format($format);
        } elseif (is_numeric($date)) {
            $d = date($format, $date);
        } else {
            $d = (string) $date;
        }
        return $d;
    }
102636
public function getDateFormat()
    {
        $formatter = new IntlDateFormatter(
            $this->getLocale(),
            IntlDateFormatter::MEDIUM,
            IntlDateFormatter::NONE
        );
        $format = $formatter->getPattern();

        $this->extend('updateDateFormat', $format);

        return $format;
    }