Probably this is not the most elegant solution, but you can use \DTMtoday
and \DTMcurrenttime
instead of \DTMnow
and add the options text width=3cm
and align=center
to your node. In order to change the date format, you can use \DTMsetdatestyle{ddmmyyyy}
. If you also want to get rid of the seconds, add the package option showseconds=false
to the datetime2
package.
Full example:
\documentclass[12pt,margin=3mm]{standalone}
\usepackage{newtxtext}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usepackage{datetime2}
\usepackage{fontawesome5}
\DTMsetdatestyle{ddmmyyyy}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node[minimum size=4cm,
draw=red!60,
circle,
line width=2mm,
text width=3cm,
align=center]
{\large \bfseries \mbox{\DTMtoday} \DTMcurrenttime};
\node at (0,1) (A) {\textcolor{Green}{\Large \faCheckCircle}};
\node at (0,-1) (B) {\large \textsc{Approved}};
\end{tikzpicture}
\end{document}
Here is another version using the italian
localization module.
\documentclass[12pt,margin=3mm,italian]{standalone}
\usepackage{newtxtext}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usepackage[useregional=numeric,showseconds=true,showzone=false]{datetime2}
\usepackage{fontawesome5}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node[minimum size=4cm,
draw=red!60,
circle,
line width=2mm,
text width=3cm,
align=center]
{\large \bfseries \mbox{\DTMtoday} \DTMcurrenttime};
\node at (0,1) (A) {\textcolor{Green}{\Large \faCheckCircle}};
\node at (0,-1) (B) {\large \textsc{Approved}};
\end{tikzpicture}
\end{document}
\DTMsetdatestyle{ddmmyyyy}
to change the date from "year-month-day" to "day-month-year". How exactly should the "time" part look like? – leandriis Oct 17 '20 at 21:13