Returns the timestamp for first day of the year for the given date.

@param	timestamp
@return	timestamp
1987
public static function firstDayOfYear($ts = null)
	{
		// default to now
		if ($ts === null) $ts = sfDateTimeToolkit::now();
		
		return sfTime::subtractMonth(sfTime::firstDayOfMonth($ts), date('m', $ts) - 1);
	}
59262
public function dayname($timestamp = 0)
    {
        $day = (int) date('w', $timestamp);

        return $this->translator->_($this->day[$day]);
    }
247039
def convert_timestamp(timestamp):
    
    datetime = dt.datetime.utcfromtimestamp(timestamp/1000.)
    return np.datetime64(datetime.replace(tzinfo=None))
84248
public static function firstDayOfMonth($ts = null)
	{
		// default to now
		if ($ts === null) $ts = sfDateTimeToolkit::now();
		
		return sfTime::subtractDay($ts, date('d', $ts) - 1);
	}
1249509
public static String padEndDateStr(String timestamp) {
		return boundTimestamp(padDigits(timestamp,LOWER_TIMESTAMP_LIMIT,
				UPPER_TIMESTAMP_LIMIT,UPPER_TIMESTAMP_LIMIT));
	}
962418
function timestamp () {
  var now = new Date()
  var diff = now.getTimezoneOffset() + 480
  now = new Date(now.getTime() + diff * 60000)

  var year = now.getFullYear()
  var month = ('0' + (now.getMonth() + 1)).slice(-2)
  var day = ('0' + now.getDate()).slice(-2)
  var hour = ('0' + now.getHours()).slice(-2)
  var minutes = ('0' + now.getMinutes()).slice(-2)
  var seconds = ('0' + now.getSeconds()).slice(-2)

  var result = '' + year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
  debug(result)
  return result
}
941945
public static Date getDate(int year, int month, int day) {
        GregorianCalendar d = new GregorianCalendar(year, month - 1, day);
        return d.getTime();
    }
841090
public long getTimestamp() {
		Long res = getEntity(invokeGet("utils/timestamp", null), Long.class);
		return res != null ? res : 0L;
	}
1311974
public static String toMediaWikiString(Timestamp timestamp){
		String original = timestamp.toString();
		StringBuffer result = new StringBuffer();
		result.append(original.substring(0,4));//year
		result.append(original.substring(5,7));//month
		result.append(original.substring(8,10));//date
		result.append(original.substring(11,13));//hour
		result.append(original.substring(14,16));//minute
		result.append(original.substring(17,19));//second
		return result.toString();
	}
560837
def get_start_of_day(year, month, day):
    
    # DST is not known in the provided date
    try:
        timestamp = time.mktime((year, month, day, 00, 00, 00, 0, 0, -1))
    except (OverflowError, ValueError):
        # Windows mktime sometimes crashes on (1970, 1, 1, ...)
        timestamp = 0.0

    return int(timestamp)
539734
public int getYear()
    {
        Timestamp adjusted = this;

        if (this._offset != null) {
            if (this._offset.intValue() != 0) {
                adjusted = make_localtime();
            }
        }
        return adjusted._year;
    }
1219750
public function getMinute($timestamp = false)
    {
        if (!$timestamp) {
            $timestamp = $this->dateTime->getTimestamp();
        }

        return date('i', $timestamp);
    }
306758
public static function shortDate($timestamp = null)
    {
        $l = self::getLocale();
        $cYear = date('Y');
        $date = date('Y-m-d', $timestamp);
        if (date('Y-m-d') == $date) {
            return I18n::get('Today %1', self::formatTime($timestamp));
        } elseif (date('Y-m-d', strtotime('yesterday')) == $date) {
            return I18n::get('Yesterday %1', self::formatTime($timestamp));
        } elseif (date('Y-m-d', strtotime('tomorrow')) == $date) {
            return I18n::get('Tomorrow %1', self::formatTime($timestamp));
        } elseif ($cYear == date('Y', $timestamp)) {
            return self::date(I18n::get('F j'), $timestamp);
        } else {
            return self::date(I18n::get('F Y'), $timestamp);
        }
    }
773093
private function getTimestamp(?int $timestamp): int
    {
        $timestamp = $timestamp ?? time();
        Assertion::greaterOrEqualThan($timestamp, 0, 'Timestamp must be at least 0.');

        return $timestamp;
    }
708199
public static function createFromDOSTimestamp($timestamp, $timezone = null)
    {
        $year          = (($timestamp >> 25) & 0x7f) + 1980;
        $mon           = ($timestamp >> 21) & 0x0f;
        $mday          = ($timestamp >> 16) & 0x1f;
        $hours         = ($timestamp >> 11) & 0x1f;
        $minutes       = ($timestamp >> 5) & 0x3f;
        $seconds       = 2 * ($timestamp & 0x1f);
        $unixTimestamp = mktime($hours, $minutes, $seconds, $mon, $mday, $year);

        return static::createFromTimestamp($unixTimestamp, $timezone);
    }
558431
static public Timestamp adjustTimestamp(Timestamp timestamp)
  {
    long milliToAdjust = ResultUtil.msDiffJulianToGregorian(timestamp);

    if (milliToAdjust != 0)
    {

      if (logger.isDebugEnabled())
      {
        logger.debug("adjust timestamp by {} days", milliToAdjust / 86400000);
      }

      Timestamp newTimestamp = new Timestamp(timestamp.getTime()
                                             + milliToAdjust);

      newTimestamp.setNanos(timestamp.getNanos());

      return newTimestamp;
    }
    else
    {
      return timestamp;
    }
  }
12115
@SuppressWarnings("unchecked")
  public Timestamp getTimestamp(String name) {
    return ((Value<Timestamp>) getValue(name)).get();
  }