Formatting 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 ?
 
T

Tom Porterfield

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");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top