generate banner with today's date and correct version
761810
function createBanner () {
  const today = new Date().toISOString().substr(0, 10) // today, formatted as yyyy-mm-dd
  const version = getVersion()

  return String(fs.readFileSync(HEADER))
    .replace('@@date', today)
    .replace('@@version', version)
}
1299190
private static String replacePlaceholders(String containerNamePattern, String imageName, String nameAlias, Date buildTimestamp) {

        Map<String, FormatParameterReplacer.Lookup> lookups = new HashMap<>();

        lookups.put("a", () -> nameAlias);
        lookups.put("n", () -> cleanImageName(imageName));
        lookups.put("t", () -> String.valueOf(buildTimestamp.getTime()));
        lookups.put("i", () -> INDEX_PLACEHOLDER);

        return new FormatParameterReplacer(lookups).replace(containerNamePattern);
    }
387007
def now_date(str=False):
    """"""
    if str:
        return datetime.datetime.now().strftime("%Y-%m-%d")
    return datetime.date.today()
1202280
def banner(text, border='=', width=80):
    
    text_padding = '{0:^%d}' % (width)
    LOG.info(border * width)
    LOG.info(text_padding.format(text))
    LOG.info(border * width)
1059728
def render_date(date, tz=pytz.utc, fmt=_FULL_OUTPUT_FORMAT):
    """"""
    local = date.astimezone(tz)
    ts = __date_to_millisecond_ts(date)
    return fmt.format(
            ts=ts,
            utc=date.strftime(_DATE_FORMAT),
            millis=ts % 1000,
            utc_tz=date.strftime(_TZ_FORMAT),
            local=local.strftime(_DATE_FORMAT),
            local_tz=local.strftime(_TZ_FORMAT),
            delta=render_delta_from_now(date))
273444
def versions(ctx, archive_name):
    '''
    
    '''

    _generate_api(ctx)

    var = ctx.obj.api.get_archive(archive_name)
    click.echo(pprint.pformat(map(str, var.get_versions())))
1257303
def bump_minor_version():
    """"""
    version = load_version_as_list()
    print('current version: {}'.format(format_version_string(version)))
    version[-1] += 1
    print('new version: {}'.format(format_version_string(version)))

    contents = "__version__ = '{}'\n".format(format_version_string(version))

    with open(VERSION_PATH, 'w') as wfile:
        wfile.write(contents)
733785
def print_date(min_ratio=None, pval=0.05):
        """"""
        import goatools

        # Header contains provenance and parameters
        date = datetime.date.today()
        print("# Generated by GOATOOLS v{0} ({1})".format(goatools.__version__, date))
        print("# min_ratio={0} pval={1}".format(min_ratio, pval))
683190
function addTimeTags(obj, options) {
	var data,
		iso,
		cn = options.className,
		restictedWords = ['today', 'tomorrow', 'yesterday'],
		tag = '',
		date = '',
		x = 0,
		i;


	if (options.publishedDate) {
		data = chrono.parse(options.text, options.publishedDate);
	} else {
		data = chrono.parse(options.text);
	}

	//console.log(JSON.stringify(data))

	if (data.length > -1) {
		i = data.length;
		while (x < i) {

			date = data[x].startDate;

			// do not use: 
			// impliedComponents for day, month
			// text containing today, tomorrow, yesterday

			if (!data[x].start.impliedComponents) {
				data[x].start.impliedComponents = [];
			}

			if (options.publishedDate || (
				data[x].start.impliedComponents.indexOf('day') === -1 && data[x].start.impliedComponents.indexOf('month') === -1 && constainRestrictedWords(data[x].text) === false
			)) {



				if (data[x].start.timezoneOffset) {
					// add timezone text parse to text based local time 
					iso = buildISOLocalDate(data[x].start) + moment('2014-01-01:00:00:00').zone(data[x].start.timezoneOffset).format('Z');
				} else {
					if (options.publishedDate && moment.parseZone(options.publishedDate).zone() !== 0) {
						// add timezone from to publishedDate to text based local time
						iso = buildISOLocalDate(data[x].start) + moment.parseZone(options.publishedDate).format('Z');
					} else {
						// localtime
						iso = buildISOLocalDate(data[x].start);
					}
				}

				// correct tomorrow issue
				if(data[x].text.toLowerCase().indexOf('tomorrow') > -1){
					var today = new Date(options.publishedDate);
					today.setDate(today.getDate() + 1);
					// correct data
					data[x].start.year = today.getFullYear();
					data[x].start.month = today.getMonth();
					data[x].start.day = today.getDate();
					data[x].startDate = today.toISOString();
					// correct iso
					iso = buildISOLocalDate(data[x].start); 
				}

				// correct tonight issue
				if(data[x].text.toLowerCase().indexOf('tonight') > -1){
					var today = new Date(options.publishedDate);
					// correct data
					data[x].start.year = today.getFullYear();
					data[x].start.month = today.getMonth();
					data[x].start.day = today.getDate();
					data[x].startDate = today.toISOString();
					// correct iso
					iso = buildISOLocalDate(data[x].start);
				}


				// return only date element if we do not have a time
				if (!data[x].start.hour) {
					iso = iso.split('T')[0];
				}

				tag = '<time class="' + cn.date + '" datetime="' + iso + '">' + data[x].text + '</time>';
				obj.html = obj.html.replace(data[x].text, tag);

			} 

			// remove unneeded data
			delete data[x].concordance;
			delete data[x].index;
			if (!utils.hasProperties(data[x].start.impliedComponents)) {
				delete data[x].start.impliedComponents;
			}

			x++;
		}

		if (data.length > 0) {
			if (!obj.time) {
				obj.time = [];
			}
			obj.time = data;
		}

	}



	return obj;
}
577247
public function generateHoursToday() {
    $hours = func_get_args();
    $days = [
      'Monday',
      'Tuesday',
      'Wednesday',
      'Thursday',
      'Friday',
      'Saturday',
      'Sunday',
    ];
    $timezone = new \DateTimeZone(\Drupal::config('system.date')->get('timezone')['default']);
    $date = DrupalDateTime::createFromTimestamp(REQUEST_TIME, $timezone);
    $today = $date->format('l');

    return [
      '#markup' => '<span class="today">' . $hours[array_search($today, $days)] . '</span>',
    ];
  }
407136
def current_version():
    """"""
    filepath = os.path.abspath(
        project_root / "directory_components" / "version.py")
    version_py = get_file_string(filepath)
    regex = re.compile(Utils.get_version)
    if regex.search(version_py) is not None:
        current_version = regex.search(version_py).group(0)
        print(color(
            "Current directory-components version: {}".format(current_version),
            fg='blue', style='bold'))
        get_update_info()
    else:
        print(color(
            'Error finding directory-components version.',
            fg='red', style='bold'))
1110576
def global_custom_theme(request):
    """"""
    today = datetime.datetime.now().date()
    theme = {}

    if today.month == 3 and (14 <= today.day <= 16):
        theme = {"css": "themes/piday/piday.css"}

    return {"theme": theme}
441072
private static BannerUpdate parseNextBannerUpdate(Element element) {
        BannerUpdate bannerUpdate = new BannerUpdate();

        bannerUpdate.setSeasonNum(DOMHelper.getValueFromElement(element, "SeasonNum"));
        bannerUpdate.setSeriesId(DOMHelper.getValueFromElement(element, SERIES));
        bannerUpdate.setFormat(DOMHelper.getValueFromElement(element, "format"));
        bannerUpdate.setLanguage(DOMHelper.getValueFromElement(element, "language"));
        bannerUpdate.setPath(DOMHelper.getValueFromElement(element, "path"));
        bannerUpdate.setTime(DOMHelper.getValueFromElement(element, TIME));
        bannerUpdate.setType(DOMHelper.getValueFromElement(element, "type"));

        return bannerUpdate;
    }
1152449
private function setTodayHijriDate()
    {
        $today = $this->convertTodayToHijri();
        $this->arYear = (int)$today['arYear'];
        $this->arMonth = (int)$today['arMonth'];
        $this->arDay = (int)$today['arDay'];
    }
1168123
def _build_date_header_string(self, date_value):
		""""""
		if isinstance(date_value, datetime):
			date_value = time.mktime(date_value.timetuple())
		if not isinstance(date_value, basestring):
			date_value = formatdate(date_value, localtime=True)
		# Encode it here to avoid this:
		# Date: =?utf-8?q?Sat=2C_01_Sep_2012_13=3A08=3A29_-0300?=
		return native(date_value)
61109
def version(verbose):
    """"""
    print(Fore.BLUE + '-=' * 15)
    print(Fore.YELLOW + 'Superset ' + Fore.CYAN + '{version}'.format(
        version=config.get('VERSION_STRING')))
    print(Fore.BLUE + '-=' * 15)
    if verbose:
        print('[DB] : ' + '{}'.format(db.engine))
    print(Style.RESET_ALL)
223926
private function createDefaultShipmentDate() {
		$now = time();
		$weekDay = date('w', $now);

		if($weekDay === 0)
			$now += 86400; // Increase Day by 1 if Sunday

		return date('Y-m-d', $now);
	}