\documentclass{article}
\usepackage{ifpdf,ifxetex} 
\ifpdf
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}

\else
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{italian}
\fi 
\begin{document}
\today
\end{document}