A visible box on the right hand side of the document

How can I get a small box at the right hand side of the document as in the figure below:

My initial attempt failed:

\begin{flushright}
\begin{tcolorbox}
\textbf{Date:11/12/2018}\\
\textbf{Time: 2:30 PM}
\end{tcolorbox}
\end{flushright}


Thank you.

• Welcome to TeX.SE. While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. Dec 7 '18 at 5:59

You can specify the text width=3cm, or use tcbox{} along with a table:

Code:

\documentclass{article}
\usepackage{showframe}
\usepackage{tcolorbox}

\begin{document}

\begin{flushright}
\begin{tcolorbox}[text width=3cm]
\textbf{Date:11/12/2018}\\
\textbf{Time: 2:30 PM}
\end{tcolorbox}
\end{flushright}

\begin{flushright}
\tcbox[left=2pt,right=2pt]{%
\bfseries
\begin{tabular}{@{}ll@{}}
Date: & 11/12/2018 \\
Time: & 2:30 PM    \\
\end{tabular}%
}%
\end{flushright}

\end{document}