/*
getADate Returns a new DateTime object reference if possible,
otherwise null.
@return retDT A DateTime object reference.
10945
private DateTime getADate(String s) {
        DateTime retDT = null;
        try
        {
            retDT = new DateTime( s );
        } // the try
        catch(IllegalArgumentException pe)
        {
            // ignore it here, caller sees null
        } // the catch
        return retDT;
    }
1015483
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    @JsonProperty("updated_at")
    public Date getUpdatedAt() {
        return updatedAt;
    }
376979
public static DateTime getDateTime(String strTime) {
        DateTime dateTime = null;
        if ((dateTime = tryFormat(strTime, dateTimeWithSubSecAndTZFormat)) == null) {
            if ((dateTime = tryFormat(strTime, dateTimeAndTZFormat)) == null) {
                if ((dateTime = tryFormat(strTime, dateTimeWithSubSecFormat)) == null) {
                    if ((dateTime = tryFormat(strTime, dateTimeFormat)) == null) {
                        if ((dateTime = tryFormat(strTime, dateHourMinOnlyFormat)) == null) {
                            if ((dateTime = tryFormat(strTime, dateHourOnlyFormat)) == null) {
                                if ((dateTime = tryFormat(strTime, dateTimeWithSubSecAndTZWithSpaceFormat)) == null) {
                                    if ((dateTime = tryFormat(strTime, dateTimeAndTZWithSpaceFormat)) == null) {
                                        if ((dateTime = tryFormat(strTime, dateTimeWithSubSecWithSpaceFormat)) == null) {
                                            if ((dateTime = tryFormat(strTime, dateTimeWithSpaceFormat)) == null) {
                                                if ((dateTime = tryFormat(strTime, dateHourMinWithSpaceOnlyFormat)) == null) {
                                                    if ((dateTime = tryFormat(strTime, dateHourWithSpaceOnlyFormat)) == null) {
                                                        if ((dateTime = tryFormat(strTime, dateOnlyFormat)) == null) {
                                                            if ((dateTime = tryFormat(strTime, yearMonthOnlyFormat)) == null) {
                                                                if ((dateTime = tryFormat(strTime, yearOnlyFormat)) == null) {
                                                                    return dateTime;
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return dateTime;
    }
596171
public T get() {
    long expiration = whenItExpires;
    long now = System.nanoTime();

    // if uninitialized or expired update value
    if (expiration == 0 || now >= expiration) {
      synchronized (this) {
        // ensure a different thread didn't update it
        if (whenItExpires == expiration) {
          whenItExpires = now + durationNanos;
          try {
            value = getter.call();
          } catch (Exception e) {
            // shouldn't happen
            throw Throwables.propagate(e);
          }
        }
      }
    }
    return value;
  }
746560
public function getDateTime() {
    $result = new \DateTime();
    $result->setTimestamp((double) $this->pb->getTime() / 1e6);
    return $result;
  }
732342
public function getCreatedAtTimestamp(): ?int
    {
        if (!$this->hasCreatedAt()) {
            return null;
        }

	    $timestamp = strtotime($this->getCreatedAt() . 'UTC');

	    if ($timestamp === false) {
		    throw new Exception("Unable to get timestamp from \"{$this->getCreatedAt()}\"");
	    }

	    return $timestamp;
    }
1373214
function getDateObject(datetime) {
  var t = datetime instanceof Date ? datetime : new Date(datetime);
  if (!t.getDate()) {
    t = new Date();
  }
  return t;
}
326001
public static Date parseDate(String strdate) {

        /* Return in case the string date is not set */
        if (strdate == null || strdate.length() == 0) return null;

        Date result = null;
        strdate = strdate.trim();
        if (strdate.length() > 10) {

            /* Open: deal with +4:00 (no zero before hour) */
            if ((strdate.substring(strdate.length() - 5).indexOf("+") == 0 || strdate.substring(strdate.length() - 5).indexOf("-") == 0) && strdate.substring(strdate.length() - 5).indexOf(":") == 2) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                String sign = strdate.substring(strdate.length() - 5, strdate.length() - 4);
                strdate = strdate.substring(0, strdate.length() - 5) + sign + "0" + strdate.substring(strdate.length() - 4); //$NON-NLS-1$
            }

            String dateEnd = strdate.substring(strdate.length() - 6);

            /*
             * try to deal with -05:00 or +02:00 at end of date replace with -0500 or
             * +0200
             */
            if ((dateEnd.indexOf("-") == 0 || dateEnd.indexOf("+") == 0) && dateEnd.indexOf(":") == 3) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
                if (!"GMT".equals(strdate.substring(strdate.length() - 9, strdate.length() - 6))) { //$NON-NLS-1$
                    String oldDate = strdate;
                    String newEnd = dateEnd.substring(0, 3) + dateEnd.substring(4);
                    strdate = oldDate.substring(0, oldDate.length() - 6) + newEnd;
                }
            }
        }

        /* Try to parse the date */
        int i = 0;
        while (i < CUSTOM_DATE_FORMATS.length) {
            try {

                /*
                 * This Block needs to be synchronized, because the parse-Method in
                 * SimpleDateFormat is not Thread-Safe.
                 */
                synchronized (CUSTOM_DATE_FORMATS[i]) {
                    return CUSTOM_DATE_FORMATS[i].parse(strdate);
                }
            } catch (ParseException e) {
                i++;
            } catch (NumberFormatException e) {
                i++;
            }
        }
        return result;
    }
468410
protected static function getDateTime()
    {
        // Lazyload
        if (null === self::$dateTime) {
            /* @var Doozr_Datetime_Service self::$dateTime */
            self::$dateTime = Doozr_Loader_Serviceloader::load('datetime');
        }

        return self::$dateTime;
    }
25466
public function getLastRead(): \DateTime
    {
        if ($this->caching == false) {
            return \DateTime::createFromFormat("F d Y H:i:s.", date("F d Y H:i:s.", fileatime($this->getAbsoluteFilePath())));
        }

        if ($this->lastRead == null) {
            $this->lastRead = \DateTime::createFromFormat("F d Y H:i:s.", date("F d Y H:i:s.", fileatime($this->getAbsoluteFilePath())));
        }

        return $this->lastRead;
    }
1334520
protected Date getReferenceDate() throws IOException {
        Date referenceDate = EnvUtil.loadTimestamp(getBuildTimestampFile());
        return referenceDate != null ? referenceDate : new Date();
    }
90693
@Override
    public DateTime getDateTime(int index) {
        return new DateTime(rows.get(row).getString(index));
    }
675511
public function getDateOfBirth() : ?DateTime
     {
        $rtn = $this->data['date_of_birth'];

        if (!empty($rtn)) {
            $rtn = new DateTime($rtn);
        }

        return $rtn;
     }
446042
static public String getFormattedDate(long dt)
    {
        String ret = "";
        SimpleDateFormat df = null;

        try
        {
            if(dt > 0)
            {
                df = formatPool.getFormat(DATE_FORMAT);
                df.setTimeZone(DateUtilities.getCurrentTimeZone());
                ret = df.format(new Date(dt));
            }
        }
        catch(Exception e)
        {
        }

        if(df != null)
            formatPool.release(df);

        return ret;
    }
1313308
public static function get_DateTime( &$dateTime )
    {
        if( $dateTime instanceof DateTime ) {
            return $dateTime;
        }
        return !is_null($dateTime)
            ? new DateTime( $dateTime )
            : null
            ;
    }
1058747
public long getGenerated() {
    long returnDate = (new Date(0L)).getTime();

    if (this.isDecoded) {
      returnDate = this.generated;
    } else {
      try {
        this.decryptData();
      } catch (Exception e) {
        log.error("No generated timestamp available!");
      }
      returnDate = this.generated;
    }

    return returnDate;
  }
621890
private function getDateFromDublinCore(): ?\DateTime {
        $dt = null;
        $nodes = $this->article()->getRawDoc()->find('*[name="dc.date"], *[name="dc.date.issued"], *[name="DC.date.issued"]');

        /* @var $node Element */
        foreach ($nodes as $node) {
            try {
                if ($node->hasAttribute('content')) {
                    $dt = new \DateTime($node->getAttribute('content'));
                    break;
                }
            }
            catch (\Exception $e) {
                // Do nothing here in case the node has unrecognizable date information.
            }
        }

        if (!is_null($dt)) {
            return $dt;
        }

        return $dt;
    }