Jump to content
Sign in to follow this  
Parcker

Calcular dias

Recommended Posts

Parcker

Boas, estou com o seguinte problema. Queria calcular os dias entre uma data e outra. Por exemplo isto:

exemploz.jpg

É introduzido numa textbox uma data e noutra textbox outra data e quero que ele calcule ao carregar no botão o numero de dias que passaram entre uma e outra. Ou seja neste caso na 3ª textbox queria que aparecesse 13. Espero ter-me expressado bem.

Agradeço ajuda ;)

Share this post


Link to post
Share on other sites
Caça

Podes subtrair as datas

Dim d1 As Date = New Date(2011, 1, 1)
Dim d2 As Date = New Date(2011, 1, 5)
MsgBox((d2.Date - d1.Date).TotalDays)


Pedro Martins

Não respondo a duvidas por PM

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.