Q: How to advance dates by alternate values I use the code below to create schedules of weekly lectures (on fridays):
\documentclass{article}
\usepackage{advdate}

%... Set the first lecture date
\ThisYear{2019}
\ThisMonth{3}
\ThisDay{1}

\newif\iffirst
    \firsttrue
%%%
\newcommand{\nextlec}{%
  \iffirst
    \firstfalse
  \else
    \AdvanceDate[7]%
  \fi
  \section*{\today}
    \vspace{-5mm}
}

\begin{document}
\nextlec
Lecture 01.

\nextlec
Lecture 02.

\nextlec
Lecture 03.

\nextlec
Lecture 04.

\nextlec
Lecture 05.

\end{document}

How can I change it (still using advdate) if I want \nextlec returning a two-lectures-a-week schedule (say, on tuesdays and on thursdays)?

A: I am not entirely sure if this is what you want but the code below alternates between adding 2 and 5 days to the current date (as there are 2 days between Tuesday and Thursday and 5 days between Thursday and Tuesday). I've also put the "Lecture X" title into the \nextlec command and changed the start date of the first lecture to March 3, 2019, since this is a Tuesday. The output (for the first four lectures) is:

Here is the code:
\documentclass{article}
\usepackage{advdate}

%... Set the first lecture date
\ThisYear{2019}
\ThisMonth{3}
\ThisDay{5}

\newcounter{lecture}
% make \thelecture print Lecture X, with 0-padding for lectures 1-9
\renewcommand\thelecture{%
  Lecture~\ifnum\value{lecture}<10\relax0\fi\arabic{lecture}.}
\newcount\lectureoffset% TeX counters are more convenient 
\newcommand{\nextlec}{%
  \AdvanceDate[\lectureoffset]% increase offset by 2 or 5 (initially 0)
  \ifnum\lectureoffset=2\relax\lectureoffset=5%
  \else\relax\lectureoffset=2%
  \fi%
  \refstepcounter{lecture}% increment the lecture number
  \section*{\today}\vspace{-5mm}\thelecture
}

\begin{document}

  \nextlec
  \nextlec
  \nextlec
  \nextlec
  \nextlec
  \nextlec
  \nextlec
  \nextlec
  \nextlec
  \nextlec

\end{document}

The key is that I have introduced the TeX counter \lectureoffset, which is used to print the date via \AdvanceDate[\lectureoffset]. Each time that \nextlec is used this counter is alternatively incremented by  2 or 5.
You could also use something like the pgffor package to automate this further so that, for example, to print 20 lectures you could write something like:
\foreach \lec in {1,...,20} \nextlec

For this to work you would need to add a few \global statements to the definition of \nextlec:
\newcommand{\nextlec}{%
  \AdvanceDate[\lectureoffset]% increase offset by 2 or 5
  \ifnum\lectureoffset=2\relax\global\lectureoffset=5%
  \else\relax\global\lectureoffset=2%
  \fi%
  \refstepcounter{lecture}% increment the lecture number
  \section*{\today}\vspace{-5mm}\thelecture
}

