Latif
1
Hi.
I’m having issue in date to receive in correct form.
I want 1 of current month and year… how can i get that… I used new DateTime(now.year, now.month, 1) but the format is not correct…
I want 1 of month either date is 7, 12 or 25 and then current month and current year.
how can i get taht.
2 Likes
Date.Now
use this to get date!
Hey @Latif,
Use DateTime.Now.ToString(“dd//MM/yyyy”)
Latif
4
DateTime.Now.ToString(“dd//MM/yyyy”)
gave me result

the result is correct. but i want 07 to start of evert month (01) the first of the current month. how to write that now…
Latif
5
the finance system where i want to add is accepting date like (01(always)-mm(current month)-yyyy(current year))
So how can i get that…
mz3bel
(Mohssine HILAL)
6
Hi @Latif
So you mean that the month and the year must be dynamic always changes right ? But the day must remain always first of the month is that correct ?
@Latif If 01 is Always present you can do this:
“01-”+DateTime.Now.ToString(“MM-yyyy”)
1 Like
new DateTime(Now.Year, Now.Month, 01).ToString(“dd-MM-yyyy”)

cheers @Latif
Hi @Latif
Try this one I hope you will get solution
DateTime.Now.ToString(“dd//MM/yyyy”).Split("/"c)(0)
Regards,
Kommi Jeevan.
Hey @Latif,
Try using this in assigns:
DateVar = DateTime.Now.ToString(“dd/MM/yyyy”)
DateVarSplit = Date.Split({“/”},StringSplitOptions.None)
Use a message box to output:
“01/” + DateVarSplit(1) +“/”+ DateVarSplit(2)
Should look a bit like this:

system
(system)
Closed
13
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.