Function: time-date--day-in-year

time-date--day-in-year is a byte-compiled function defined in time-date.el.gz.

Signature

(time-date--day-in-year TIM)

Documentation

Return the day number within the year corresponding to the decoded time TIM.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/time-date.el.gz
(defun time-date--day-in-year (tim)
  "Return the day number within the year corresponding to the decoded time TIM."
  (let* ((month (decoded-time-month tim))
         (day (decoded-time-day tim))
         (year (decoded-time-year tim))
	 (day-of-year (+ day (* 31 (1- month)))))
    (when (> month 2)
      (setq day-of-year (- day-of-year (/ (+ 23 (* 4 month)) 10)))
      (when (date-leap-year-p year)
	(setq day-of-year (1+ day-of-year))))
    day-of-year))