Determine the creation date for the publication date.
429918
def get_publication_date(self, **kwargs):
        """"""
        date_string = kwargs.get('content', '')
        date_match = CREATION_DATE_REGEX.match(date_string)
        month_match = CREATION_MONTH_REGEX.match(date_string)
        year_match = CREATION_YEAR_REGEX.match(date_string)
        # Check if a date match exists.
        if date_match:
            (year, month, day) = date_match.groups('')
            # Create the date.
            try:
                creation_date = datetime.date(int(year), int(month), int(day))
            except ValueError:
                return None
            else:
                return '%s/%s/%s' % (
                    format_date_string(creation_date.month),
                    format_date_string(creation_date.day),
                    creation_date.year,
                )
        elif month_match:
            (year, month) = month_match.groups('')
            # Create the date.
            try:
                creation_date = datetime.date(int(year), int(month), 1)
            except ValueError:
                return None
            else:
                return '%s/%s' % (
                    format_date_string(creation_date.month),
                    creation_date.year,
                )
        elif year_match:
            year = year_match.groups('')[0]
            return year
        else:
            return None
1167311
def pub_date(soup):
    
    pub_date = first(raw_parser.pub_date(soup, date_type="pub"))
    if pub_date is None:
        pub_date = first(raw_parser.pub_date(soup, date_type="publication"))
    if pub_date is None:
        return None
    (day, month, year) = ymd(pub_date)
    return date_struct(year, month, day)
989165
function groupDate({creationDate: date}) {
    const root = 'focus.notifications.groups';
    if(_isYoungerThanA('day', date)) {
        return `${root}.0_today`;
    }
    if(_isYoungerThanA('week', date)) {
        return `${root}.1_lastWeek`;
    }
    if(_isYoungerThanA('month', date)) {
        return `${root}.2_lastMonth`;
    }
    return `${root}.3_before`;
}
582055
def make_article_info_dates(self):
        
        dates_div = etree.Element('div', {'id': 'article-dates'})

        d = './front/article-meta/history/date'
        received = self.article.root.xpath(d + "[@date-type='received']")
        accepted = self.article.root.xpath(d + "[@date-type='accepted']")
        if received:
            b = etree.SubElement(dates_div, 'b')
            b.text = 'Received: '
            dt = self.date_tuple_from_date(received[0], 'Received')
            formatted_date_string = self.format_date_string(dt)
            append_new_text(dates_div, formatted_date_string + '; ')
        if accepted:
            b = etree.SubElement(dates_div, 'b')
            b.text = 'Accepted: '
            dt = self.date_tuple_from_date(accepted[0], 'Accepted')
            formatted_date_string = self.format_date_string(dt)
            append_new_text(dates_div, formatted_date_string + '; ')
        #Published date is required
        pub_date = self.article.root.xpath("./front/article-meta/pub-date[@pub-type='epub']")[0]
        b = etree.SubElement(dates_div, 'b')
        b.text = 'Published: '
        dt = self.date_tuple_from_date(pub_date, 'Published')
        formatted_date_string = self.format_date_string(dt)
        append_new_text(dates_div, formatted_date_string)

        return dates_div
104010
def created(self):
        ''
        return dateutil.parser.parse(str(self.f.currentRevision.created))
255676
public void setCreatedDate(Date createdDate) {
        _createdDate = createdDate == null ? null : new Date(createdDate.getTime());
    }
696754
@Override
	public Date engineGetCreationDate(String s) {
		try {
			ResourceTrustAnchor trustAnchor = getCertificateEntry(s);
			if (trustAnchor != null) {
				return trustAnchor.getTrustAnchor().getTrustedCert()
						.getNotBefore();
			} else {
				CredentialWrapper credential = getKeyEntry(s);
				if (credential != null) {
					return credential.getCredential().getNotBefore();
				}
			}
		} catch (ResourceStoreException e) {
			return null;
		}
		return null;
	}
824322
public function publishDate($var = null)
    {
        if ($var !== null) {
            $this->publish_date = Utils::date2timestamp($var, $this->dateformat);
        }

        return $this->publish_date;
    }
1260956
public function onBeforePublish()
    {
        /**
         * @var DBDatetime $publishDate
         */
        $publishDate = $this->dbObject('PublishDate');
        if (!$publishDate->getValue()) {
            $this->PublishDate = DBDatetime::now()->getValue();
            $this->write();
        }

        $this->Summary = trim($this->Summary);

        $this->extend('onBeforePublish');
    }
994421
public Date getPublishDateTime() {
        if (getPublishDate() == null) {
            return null;
        }

        Calendar cal = Calendar.getInstance();
        cal.setTime(getPublishDate());
        cal.set(Calendar.HOUR, getPublishHour());
        cal.set(Calendar.MINUTE, getPublishMinute());
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        cal.set(Calendar.AM_PM, getPublishAmPm());
        return cal.getTime();
    }
413063
private function computeFilePublishDate($filepath)
    {
        $creationTimestamp = filectime($filepath);
        if (false === $creationTimestamp) {
            throw new \InvalidArgumentException("Could not get creation date of file $filepath");
        }
        $creationDateTime = new \DateTime('@' . $creationTimestamp);

        return $creationDateTime->format('Y-m-d');
    }
381428
def date_created(self):
        """"""
        date_created = self.xml.find('institution-profile/date-created')
        if date_created is not None:
            date_created = (int(date_created.attrib['year']),
                            int(date_created.attrib['month']),
                            int(date_created.attrib['day']))
        else:
            date_created = (None, None, None)
        return date_created
658028
def _get_published(self, entry):
        
        published = None
        if hasattr(entry, 'published_parsed'):
            if entry.published_parsed is not None:
                published = datetime.datetime.utcfromtimestamp(time.mktime(entry.published_parsed))
        elif hasattr(entry, 'created_parsed'):
            if entry.created_parsed is not None:
                published = datetime.datetime.utcfromtimestamp(time.mktime(entry.created_parsed))
        elif hasattr(entry, 'updated_parsed'):
            if entry.updated_parsed is not None:
                published = datetime.datetime.utcfromtimestamp(time.mktime(entry.updated_parsed))
        return published
517940
def creation_time(self):
    """"""
    timestamp = self._fsntfs_file_entry.get_creation_time_as_integer()
    return dfdatetime_filetime.Filetime(timestamp=timestamp)
262125
def build_pub_dates(article, pub_dates):
    ""
    for pub_date in pub_dates:
        # always want a date type, take it from pub-type if must
        if pub_date.get('date-type'):
            date_instance = ea.ArticleDate(pub_date.get('date-type'),
                                           pub_date.get('date'))
        elif pub_date.get('pub-type'):
            date_instance = ea.ArticleDate(pub_date.get('pub-type'),
                                           pub_date.get('date'))
        # Set more values
        utils.set_attr_if_value(date_instance, 'pub_type', pub_date.get('pub-type'))
        utils.set_attr_if_value(date_instance, 'publication_format',
                                pub_date.get('publication-format'))
        utils.set_attr_if_value(date_instance, 'day', pub_date.get('day'))
        utils.set_attr_if_value(date_instance, 'month', pub_date.get('month'))
        utils.set_attr_if_value(date_instance, 'year', pub_date.get('year'))
        article.add_date(date_instance)
748962
def process_date_created(self, text):
        """"""
        date = parse(text)
        if self.date_created == 'N/A':
            self.date_created = date
        if date < self.date_created:
            self.date_created = date
128528
def clear_created_date(self):
        
        # Implemented from template for osid.assessment.AssessmentOfferedForm.clear_start_time_template
        if (self.get_created_date_metadata().is_read_only() or
                self.get_created_date_metadata().is_required()):
            raise errors.NoAccess()
        self._my_map['createdDate'] = self._created_date_default