Usar condição de data

Queria ajuda para fazer uma condição com um valor de data.
Por exemplo, no meu imput tem uma informação de data, quero saber se essa data é menor ou igual ao dia 25 do mês atual.

1 Like

Tente usar este-

Now.CompareTo(Date.Parse("06/25/2021"))

se a data for igual a 25 então a saída será 0 e se a data for menor que 25 então a saída será -1 e se for maior que 1.

deixe-me saber se precisar de mais ajuda.
lembre-se do meu português, pois estou usando o google tradutor.

1 Like

Vou tentar. Obrigada!

Try this also

CDate(inputDT.ToString).ToString("MM/dd/yyy") <= CDate(Now.Month.ToString+"/25/"+Now.Year.ToString).ToString("MM/dd/yyy")

Could you please tell what is the format of input Date

string (“dd/MM/yyyy”)
no caso eu quero apenas comparar se o dia é maior que 25.
Eu tentei data.ToString <=Now.ToString(“26/MM/yyyy”) mas ainda não tenho certeza se funcionou.

send me the xaml file and input file. What is the error? Can you send screenshot?

Date.ParseExact(input.ToString, "dd/MM/yyyy", Globalization.CultureInfo.InvariantCulture) > CDate(Now.Month.ToString+"/25/"+Now.Year.ToString)

The above statement will result in a Boolean expression. True if Date is greater than 25 and False if it is lesser.