Method to get string value of date from Calendar

@return String the date
969216
private String getCalendarAsString(Calendar cal) {
		SimpleDateFormat formatter = getDateTimeFormatter();
		Date date = cal.getTime();
		return formatter.format(date).concat("Z");
	}
1358573
public String getAmazonDateString(Date date) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT);
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone(TIME_ZONE));
        return simpleDateFormat.format(date);
    }
942615
public function getCalendar() : ?string 
    {
        if ( ! $this->hasCalendar()) {
            $this->setCalendar($this->getDefaultCalendar());
        }
        return $this->calendar;
    }
756533
public function getAllCalendarData()
    {
        $success     = 0;
        $request     = $this->getRequest();
        $data        = array();

        if($request->isGet())
        {
            $calendarData  = $this->getServiceLocator()->get('MelisCalendarService');

            if(!empty($calendarData)){
                $data    = "";
                $success = 0;

            }
        }

        return $data;
    }
1003228
public function getContentType()
    {
        $mime = 'text/calendar; charset=utf-8';
        if (isset($this->objectData['component']) && $this->objectData['component']) {
            $mime .= '; component='.$this->objectData['component'];
        }

        return $mime;
    }
1068987
public Calendar getTimeStampDate() {
        if (timeStampToken == null)
            return null;
        Calendar cal = new GregorianCalendar();
        Date date = timeStampToken.getTimeStampInfo().getGenTime();
        cal.setTime(date);
        return cal;
    }
129602
public function getFormattedDateRangeDate() {

    // Load session instance date range date values.
    $timestamp = $this->get('timestamp')->value;
    $year_start = date('Y', $timestamp);
    $month_day_start = date('M j', $timestamp);
    $timestamp_to = $this->get('timestamp_to')->value;
    $year_to = date('Y', $timestamp_to);
    $month_day_to = date('M j', $timestamp_to);

    // Format date range to eliminate repeated values.
    if ($year_start == $year_to) {
      if (date('M', $timestamp) == date('M', $timestamp_to)) {
        if ($month_day_start == $month_day_to) {
          // M j, Y.
          $formatted_date = "$month_day_start, $year_start";
        }
        else {
          // M j - j, Y.
          $day_to = date('j', $timestamp_to);
          $formatted_date =  "$month_day_start - $day_to, $year_start";
        }
      }
      else {
        // M j - M j, Y.
        $formatted_date =  "$month_day_start - $month_day_to, $year_start";
      }
    }
    else {
      // M j, Y - M j, Y.
      $formatted_date = $month_day_start . ", $year_start - " . $month_day_to . ", $year_to";
    }

    return $formatted_date;
  }
1367613
public function toString() {
    $text = '';
    $args = array();

    $start_date = FALSE;
    $end_date = FALSE;

    // Day of the week constraint variable.
    $day_of_the_week = $this->getWeekDay($this->checkin_day);

    // Date range constraint variables.
    if ($this->start_date !== NULL && $this->start_date != (new \DateTime('1970-01-01'))) {
      $start_date = $this->start_date->format('Y-m-d');
    }
    if ($this->end_date !== NULL && $this->end_date != (new \DateTime('2999-12-31'))) {
      $end_date = $this->end_date->format('Y-m-d');
    }

    // Finally, build out the constraint text string adding components
    // as necessary.

    // Specify a date range constraint.
    if ($start_date && $end_date) {
      $text = 'From @start_date to @end_date';

      $args['@start_date'] = $start_date;
      $args['@end_date'] = $end_date;
    }

    // Specify the day of the week constraint.
    if ($day_of_the_week) {
      if ($start_date && $end_date) {
        $text = 'From @start_date to @end_date, bookings must start on @day_of_the_week';
      } else {
        $text = 'Bookings must start on @day_of_the_week';
      }

      $args['@day_of_the_week'] = $day_of_the_week;
    }

    return array('text' => $text, 'args' => $args);
  }
1130761
public function today(): AbstractCalendarDate
    {
        $tmp        = clone $this;
        $ymd        = $tmp->todayYmd();
        $tmp->year  = $ymd[0];
        $tmp->month = $ymd[1];
        $tmp->day   = $ymd[2];
        $tmp->setJdFromYmd();

        return $tmp;
    }
864499
@Deprecated
	public static String getDateString(Date date) {
		synchronized(StringUtility.class) {
			calendar.setTime(date);
			int day=calendar.get(Calendar.DATE);
			return (day>=0 && day<=9 ? "0":"")+String.valueOf(calendar.get(Calendar.DATE))+MONTHS[calendar.get(Calendar.MONTH)]+calendar.get(Calendar.YEAR);
		}
	}
615354
@Deprecated
	public static String getDateStringMMDDYYYY(Date date) {
		if(date==null) return "";
		Calendar C=Calendar.getInstance();
		C.setTime(date);
		int day=C.get(Calendar.DATE);
		int month=C.get(Calendar.MONTH)+1;
		return
			(month>=0 && month<=9 ? "0":"")
			+month
			+(day>=0 && day<=9 ? "0":"")
			+day
			+C.get(Calendar.YEAR)
		;
	}
340763
private function getDateCase()
    {
        $from = $this->from;
        $to = $this->to;

        // single date event
        if (!$to || $to->format('Ymd') === $from->format('Ymd')) {
            return 'single';
        }

        $fromDate = [
            'day'   => $from->format('d'),
            'month' => $from->format('m'),
            'year'  => $from->format('y')
        ];

        $toDate = [
            'day'   => $to->format('d'),
            'month' => $to->format('m'),
            'year'  => $to->format('y')
        ];

        $case = null;
        $case = $fromDate['day'] !== $toDate['day'] ? 'different_day' : $case;
        $case = $fromDate['month'] !== $toDate['month'] ? 'different_month' : $case;
        $case = $fromDate['year'] !== $toDate['year'] ? 'different_year' : $case;

        return $case;
    }
1124305
public function get()
    {
        // Pre-populating the 'calendardata' is optional, if we don't have it
        // already we fetch it from the backend.
        if (!isset($this->objectData['calendardata'])) {
            $this->objectData = $this->caldavBackend->getSchedulingObject($this->objectData['principaluri'], $this->objectData['uri']);
        }

        return $this->objectData['calendardata'];
    }
207192
public function getDateFormat()
	{
		$date = strftime("%x", mktime(0, 0, 0, 1, 31, 2009));
		if (preg_match("/31[- \/.]0?1[- \/.](20)?09/", $date))
		{
			return DATEFORMAT::DMY;
		}
		elseif (preg_match("/0?1[- \/.]31[- \/.](20)?09/", $date))
		{
			return DATEFORMAT::MDY;
		}
		else
		{
			return DATEFORMAT::YMD;
		}
	}
761192
public static String getDateStr(Date date) {
        java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return sdf.format(date);
    }
395288
public function getDate()
    {
        global $wpdb;
        return $wpdb->get_var($wpdb->prepare('SELECT post_date FROM ' . $wpdb->prefix . 'posts WHERE ID = %d',
            $this->ID));
    }
841371
public function getDate()
    {
        if (!isset($this->data['date'])) {
            return null;
        }
        try {
        return (class_exists('\Carbon\Carbon')) ?
            new \Carbon\Carbon($this->data['date'], 'GMT') :
            $this->data['date'];
        } catch (\Exception $e) {
            return null;
        }
    }