Receive Date in dd-mm-yyyy

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”)

DateTime.Now.ToString(“dd//MM/yyyy”)
gave me result
image

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…

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…

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”)
image
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:

image

thanks pradeep

1 Like

@Latif
cheers brother!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.