Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- date{06/06/66}
- documentclass{article}
- usepackage{datetime}
- usepackage{etoolbox}
- usepackage{calculator}
- makeatletter
- newififIsLeapYearIsLeapYearfalse
- newcommand*{YearIsLeapYear}[1]{%
- IsLeapYearfalse%
- MODULO{#1}{4}{ModuloFourResult}%
- ifnumcomp{ModuloFourResult}{=}{0}{%
- MODULO{#1}{100}{ModuloOneHundredResult}%
- ifnumcomp{ModuloOneHundredResult}{=}{0}{%
- MODULO{#1}{400}{ModuloFourHundredResult}%
- ifnumcomp{ModuloFourHundredResult}{=}{0}{%
- IsLeapYeartrue%
- }{%
- IsLeapYearfalse%
- }%
- }{%
- IsLeapYeartrue%
- }}{IsLeapYearfalse}%
- }%
- newcounter{WorkSheet@@Day}%
- newcounter{WorkSheet@@Month}%
- newcounter{WorkSheet@@Year}%
- newcommand*{WorkSheet@@SwitchToNextMonth}{%
- setcounter{WorkSheet@@Day}{1}%
- refstepcounter{WorkSheet@@Month}%
- }%
- newcommand*{WorkSheet@@SwitchToNextYear}{%
- setcounter{WorkSheet@@Day}{1}%
- setcounter{WorkSheet@@Month}{1}%
- refstepcounter{WorkSheet@@Year}%
- }%
- newcommand*{WorkSheetDayAfterDate}[3]{%
- setcounter{WorkSheet@@Day}{#1}%
- setcounter{WorkSheet@@Month}{#2}%
- setcounter{WorkSheet@@Year}{#3}%
- %
- defMonthsWithThirtyOneDays{1}%
- defMonthsWithThirtyDays{4}%
- %
- %
- listadd{MonthsWithThirtyOneDays}{1}%
- listadd{MonthsWithThirtyOneDays}{3}%
- listadd{MonthsWithThirtyOneDays}{5}%
- listadd{MonthsWithThirtyOneDays}{7}%
- listadd{MonthsWithThirtyOneDays}{8}%
- listadd{MonthsWithThirtyOneDays}{10}%
- listadd{MonthsWithThirtyOneDays}{12}%
- %
- listadd{MonthsWithThirtyDays}{4}%
- listadd{MonthsWithThirtyDays}{6}%
- listadd{MonthsWithThirtyDays}{9}%
- listadd{MonthsWithThirtyDays}{11}%
- YearIsLeapYear{numbervalue{WorkSheet@@Year}}%
- xifinlist{numbervalue{WorkSheet@@Month}}{MonthsWithThirtyOneDays}{% It is a "long month"
- %
- ifnumcomp{value{WorkSheet@@Day}}{=}{31}{% Is the 31st day in the month!
- % Check for 12/31/...
- ifnumcomp{value{WorkSheet@@Month}}{=}{12}{%
- WorkSheet@@SwitchToNextYear}{ WorkSheet@@SwitchToNextMonth}%
- }{refstepcounter{WorkSheet@@Day}}}{%
- ifnumcomp{value{WorkSheet@@Month}}{=}{2}{% It is February
- ifnumcomp{value{WorkSheet@@Day}}{=}{28}{% Is the 28th of February
- ifIsLeapYear%
- refstepcounter{WorkSheet@@Day}%
- else%
- WorkSheet@@SwitchToNextMonth%
- fi%
- }{%
- ifIsLeapYear%
- ifnumcomp{value{WorkSheet@@Day}}{=}{29}{% Is the 29th of February
- WorkSheet@@SwitchToNextMonth}{refstepcounter{WorkSheet@@Day}}%
- else%
- refstepcounter{WorkSheet@@Day}%
- fi%
- }}{%
- % It is a month with 30 days!!
- xifinlist{numbervalue{WorkSheet@@Month}}{MonthsWithThirtyDays}{%
- ifnumcomp{value{WorkSheet@@Day}}{=}{30}{% Is the 30st day in the month!
- WorkSheet@@SwitchToNextMonth}{refstepcounter{WorkSheet@@Day}
- }}}{}%
- }%
- }%
- providecommand{Tomorrow}{%
- WorkSheetDayAfterDate{numberday}{numbermonth}{numberyear}%
- newdate{DateOfTomorrow}{numbervalue{WorkSheet@@Day}}{numbervalue{WorkSheet@@Month}}{numbervalue{WorkSheet@@Year}}%
- displaydate{DateOfTomorrow}
- }%
- makeatother
- begin{document}
- Tomorrow is Tomorrow%
- end{document}
- documentclass{beamer}
- usetheme{madrid}
- usepackage[font=Times,timeinterval=10]{tdclock}
- title{Adding Current date}
- date{tdclock}
- begin{document}
- initclock
- begin{frame}
- maketitle
- end{frame}
- begin{frame}{Ticking clock}end{frame}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement