Returns the creation date in a friendly relative format.
545212
def friendly_created_at
      current_datetime = Time.current

      if created_at > current_datetime.beginning_of_day
        I18n.l(created_at, format: :time_of_day)
      elsif created_at > current_datetime.beginning_of_week
        I18n.l(created_at, format: :day_of_week)
      elsif created_at > current_datetime.beginning_of_year
        I18n.l(created_at, format: :day_of_month)
      else
        I18n.l(created_at, format: :day_of_year)
      end
    end
132470
def get_creation_datetime(filepath):
    
    if platform.system() == 'Windows':
        return datetime.fromtimestamp(os.path.getctime(filepath))
    else:
        stat = os.stat(filepath)
        try:
            return datetime.fromtimestamp(stat.st_birthtime)
        except AttributeError:
            # We're probably on Linux. No easy way to get creation dates here,
            # so we'll settle for when its content was last modified.
            return None
749476
def creation_time(self):
    """"""
    timestamp = self._bde_volume.get_creation_time_as_integer()
    return dfdatetime_filetime.Filetime(timestamp=timestamp)
1284837
function () {
            // get client's current date
            var date = new Date();

            // turn date to utc
            var utc = date.getTime() + (date.getTimezoneOffset() * 60000);

            // set new Date object
            var new_date = new Date(utc + (3600000*settings.offset))

            return new_date;
        }
582586
def created(self):
        
        statistics = self._properties.get("statistics")
        if statistics is not None:
            millis = statistics.get("creationTime")
            if millis is not None:
                return _helpers._datetime_from_microseconds(millis * 1000.0)
814819
def date(fmt=None,timestamp=None):
    ""
    if fmt=='U': # return timestamp
        t = datetime.datetime.now()
        return int(time.mktime(t.timetuple()))
    if fmt=='c': # return isoformat 
        d = datetime.datetime.fromtimestamp(timestamp)
        return d.isoformat()
    if fmt=='Ymd':
        d = datetime.datetime.now()
        return d.strftime("%Y%m%d")
97624
def fnFromDate(self, date):
        """"""
        fn = time.strftime('comics-%Y%m%d', date)
        fn = os.path.join(self.basepath, 'html', fn + ".html")
        fn = os.path.abspath(fn)
        return fn
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
1074525
def created_at_pretty(self, date_format=None):
        """"""
        if date_format:
            return pretty_timestamp(self.created_at, date_format=date_format)
        return pretty_timestamp(self.created_at)
564003
def date_0utc(date):
    
    return ee.Date.fromYMD(date.get('year'), date.get('month'),
                           date.get('day'))
60077
def parse_date_created(dct):
    """"""
    date = dct['date-created']
    if date:
        return (int(date['@year']), int(date['@month']), int(date['@day']))
    else:
        return (None, None, None)
973066
public long getCreationTime() {
        if (!_iSess.isValid())
            throw new IllegalStateException();
        long value = 0;
        if (_iSess != null) {
            value = _iSess.getCreationTime();
        }
        return value;
    }
10748
public Date getCreationDateTime() {

		long time = 0;

		if (createtime != null) {
			time = createtime.longValue() * 1000;
		}

		if (createtime_nano != null) {
			time += (createtime_nano.longValue() / 1000000);
		}
		return new Date(time);
	}
517940
def creation_time(self):
    """"""
    timestamp = self._fsntfs_file_entry.get_creation_time_as_integer()
    return dfdatetime_filetime.Filetime(timestamp=timestamp)
571928
def get_creation_date(brain_or_object):
    
    created = getattr(brain_or_object, "created", None)
    if created is None:
        fail("Object {} has no creation date ".format(
             repr(brain_or_object)))
    if callable(created):
        return created()
    return created
869628
def pretty_date(the_datetime):
    """"""
    # Source modified from
    # http://stackoverflow.com/a/5164027/176978
    diff = datetime.utcnow() - the_datetime
    if diff.days > 7 or diff.days < 0:
        return the_datetime.strftime('%A %B %d, %Y')
    elif diff.days == 1:
        return '1 day ago'
    elif diff.days > 1:
        return '{0} days ago'.format(diff.days)
    elif diff.seconds <= 1:
        return 'just now'
    elif diff.seconds < 60:
        return '{0} seconds ago'.format(diff.seconds)
    elif diff.seconds < 120:
        return '1 minute ago'
    elif diff.seconds < 3600:
        return '{0} minutes ago'.format(int(round(diff.seconds / 60)))
    elif diff.seconds < 7200:
        return '1 hour ago'
    else:
        return '{0} hours ago'.format(int(round(diff.seconds / 3600)))
1334520
protected Date getReferenceDate() throws IOException {
        Date referenceDate = EnvUtil.loadTimestamp(getBuildTimestampFile());
        return referenceDate != null ? referenceDate : new Date();
    }