Share via


How can i get the current date?

Question

Wednesday, February 24, 2016 2:33 PM

Hi,

I'm working on an app for employees of a company, and i would like to show the 3 upcoming paydays.

I have to get the current date for this so when a payday is past, it doesnt show up anymore and the 3 new paydays will show. How do i get the current date to compare it with the upcoming payday?

Thanks.

All replies (8)

Wednesday, February 24, 2016 2:39 PM

DateTime.Now()


Wednesday, February 24, 2016 2:50 PM

I already found that but i can't figure out how that time is stored. How can i put that date in a string for example?


Wednesday, February 24, 2016 2:55 PM

It's a DateTime value.

For a string DateTime.Now().ToString();


Wednesday, February 24, 2016 3:07 PM

Thanks!


Thursday, July 14, 2016 8:24 PM

String myDate = DateTime.Now.ToString();


Wednesday, May 3, 2017 6:54 AM

@KianoushMoradian said: String myDate = DateTime.Now.ToString();

Very Thanks :) ;)


Tuesday, July 23, 2019 11:17 AM

DateTime.Now()


Tuesday, July 23, 2019 11:45 AM

todaydateandtime=DateTime.Now().ToString();