The ``Date`` header.
186066
def date(self) -> Optional[DateHeader]:
        """"""
        try:
            return cast(DateHeader, self[b'date'][0])
        except (KeyError, IndexError):
            return None
1280953
function HeDate() {
    if(!(this instanceof HeDate)) {
      return new HeDate().toString();
    }

    var date = new Date();
    date.__proto__ = this.__proto__;

    if(arguments.length == 1) {
      date.setTime(arguments[0]);
    } else if(arguments.length > 1) {
      var args = defaults(arguments, [0, 0, 1, 0, 0, 0, 0]);
      var dateArgs = args.slice(0, 3);
      var timeArgs = args.slice(3);
      date.setFullYear.apply(date, dateArgs);
      date.setHours.apply(date, timeArgs);
    }

    return date;
  }
354195
def setCurrentDate( self, date ):
        
        if ( date == self._currentDate or not date.isValid() ):
            return
        
        self._currentDate = date
        self.markForRebuild()
        
        parent = self.parent()
        if ( not parent.signalsBlocked() ):
            parent.currentDateChanged.emit(date)
            parent.titleChanged.emit(self.title())
456853
def _dates(self, key, value):
    
    if value.get('q'):
        self['date_proposed'] = normalize_date(value['q'])
    if value.get('r'):
        self['date_approved'] = normalize_date(value['r'])
    if value.get('s'):
        self['date_started'] = normalize_date(value['s'])
    if value.get('c'):
        self['date_cancelled'] = normalize_date(value['c'])
    if value.get('t'):
        self['date_completed'] = normalize_date(value['t'])

    raise IgnoreKey
674751
def prettydate(date):
    now = datetime.now(timezone.utc)
    
    diff = now - date
    # Show the timestamp rather than the relative timeframe when the difference
    # is greater than 7 days
    if diff.days > 7:
        return date.strftime("%d. %b %Y")
    return arrow.get(date).humanize()
1292648
def time_title_header_element(feature, parent):
    """"""
    _ = feature, parent  # NOQA
    header = time_title_header['string_format']
    return header.capitalize()
697905
public void setDateHeader (@Nonnull @Nonempty final String sName, @Nonnull final ZonedDateTime aDT)
  {
    _setHeader (sName, getDateTimeAsString (aDT));
  }
1150300
@Override
    public void setDateHeader(String name, long date) {

        setHeader(name, CmsDateUtil.getHeaderDate(date));
    }
268749
def date(date):
    
    date = date.value
    return (datetime.strptime(date[:-5], '%Y-%m-%dT%H:%M:%S')
            if len(date) == 24
            else datetime.strptime(date, '%Y%m%dT%H:%M:%S'))
587056
public function getHeaderDate($name)
    {
        $date = $this->getHeader($name);

        if (!is_null($date) && !empty($date)) {
            return strtotime($date);
        }
    }
1082583
@Deprecated
    public static void setDateHeader(HttpMessage message, String name, Date value) {
        setDateHeader(message, (CharSequence) name, value);
    }
361511
@Deprecated
    public static void addDateHeader(HttpMessage message, String name, Date value) {
        message.headers().add(name, value);
    }
1165964
def str_to_date(self):
        

        if hasattr(self, 'date'):
            return date(*list(map(int, self.date.split('-'))))
        else:
            return None
38281
def hdate(self, date):
        """"""
        # Sanity checks
        if date is None and isinstance(self.gdate, datetime.date):
            # Calculate the value since gdate has been set
            date = self.hdate

        if not isinstance(date, HebrewDate):
            raise TypeError('date: {} is not of type HebrewDate'.format(date))
        if not 0 < date.month < 15:
            raise ValueError(
                'month ({}) legal values are 1-14'.format(date.month))
        if not 0 < date.day < 31:
            raise ValueError('day ({}) legal values are 1-31'.format(date.day))

        self._last_updated = "hdate"
        self._hdate = date
851979
def Header(self):
    """"""
    # Call OnGetValue on options.
    _ = [option.OnGetValue() for option in self.options]
    return self.name
346927
function (date, tpl) {
    this.tpl = tpl;
    this.f  = {
        y: date.getYear() + 1900,
        m: date.getMonth() + 1,
        d: date.getDate(),
        H: date.getHours(),
        M: date.getMinutes(),
        S: date.getSeconds()
    };
}
387007
def now_date(str=False):
    """"""
    if str:
        return datetime.datetime.now().strftime("%Y-%m-%d")
    return datetime.date.today()