Formatting Date

  • Thread starter Thread starter Daniel Groh
  • Start date Start date
D

Daniel Groh

Hi all, i need to return this line:
return objPessoaFisica.datDataNascimento

But it's returning d/m/yyyy 00:00

I just need: dd/mm/yyyy

How do i do ?
 
Hi all, i need to return this line:
return objPessoaFisica.datDataNascimento

But it's returning d/m/yyyy 00:00

I just need: dd/mm/yyyy

How do i do ?

What data type is datDataNascimento? Do you want to return a DateTime
object or a string? To format a DateTime as a string in the format you
want, call its ToString method passing the appropriate format specifier.
Ex:

return objPessoaFisica.datDataNascimento.ToString("dd/MM/yyyy");
 
Back
Top