Aguirre
(Aguirre)
June 7, 2021, 12:28pm
1
Hello I need to show the current day with a single digit, for when it is less than the 10th of the month, the day I get it like this:
Now.ToString(“dd”)
In this way, it shows me the days less than 10 with two digits, that is, 01,02, …
How could I omit the 0?
Cint(Now.ToString("dd")).ToString
1 Like
Aguirre:
ow.ToString(“dd”)
@Aguirre ,
This below statement will solve your problem,
Now.ToString(“%d”)
@kumar.varun2 ,
Your statement will remove zeros in date 01 to 10, 20 and 30 as well.
put percent symbol in format of date.
but %d is better approach
Aguirre
(Aguirre)
June 7, 2021, 12:49pm
7
Pankaj.Patil:
Now.ToString(“%d”)
This solution is perfect, I ask you for a tip, I will use an “IF <10” “Now.ToString (”% d “)” but “Now.ToString (” dd ")
Do you see it as the most efficient for my problem or do you think there is a better option?
@Aguirre ,
I would recommend you that, store date in variable and compare it like below statement
todayDate = Now.ToString(“%d”)
IF todayDate < 10 {
// do your work here
}Else{
// do your other work here
}
1 Like
system
(system)
Closed
June 10, 2021, 12:54pm
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.