# Change doi font style to Times New Roman biblatex

I am trying to change doi font style to Times New Roman. By default, the font is not in Times New Roman but something else. I have tried:

\usepackage{lipsum}
\newcommand{\TNR}{\fontfamily{ptm}\selectfont}
\DeclareTextFontCommand{\textTNR}{\TNR}

\DeclareFieldFormat{doi}{ %
\color{black}{doi}%
\textTNR{\underline{
\ifhyperref
}
}
}


I have the above code by the following references link:
[1] Change font to comicneue only for one sentence [2] Formatting only the DOI using biblatex

Can anyone point out what's wrong with the above? I appreciate your time.

Assuming the rest of your document is already set up for Times (or with a Times clone), you only need \urlstyle{same} to have URLs, DOIs and the like in the main document font.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage{times}

\usepackage[backend=biber, style=authoryear]{biblatex}

\urlstyle{same}