Jump to content

Recommended Posts

Posted (edited)

Boas,

Alguém me consegue ajudar a desvendar o formato da data.

txtData.Text = Today.ToString("ddMMyy")

Com o código a cima vou buscar a data de hoje naquele formato.

Agora existe a necessidade de ir buscar a data de inicio e fim de cada Mês, ou seja, quero ir buscar o mês de janeiro, fevereiro e por ai fora.

Como é que consigo tratar a data?

Edited by thoga31
GeSHi
Posted (edited)

Boas,

podes criar uma data no primeiro dia do mes seguinte, e subtrair 1 dia, para obteres o ultimo dia do mes.

Algo assim:

Dim primeiroDiaJaneiro as DateTime  = New DateTime(2013, 1, 1)
Dim ultimoDiaJaneiro as DateTime  = New DateTime(2013, 2, 1).AddDays(-1)

Podes usar o ToString nessas variaveis depois para formatares como quiseres

Edited by thoga31
Tags CODE + GeSHi

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
×
×
  • 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.