Now() equivalent?

J

Jerome

Hi,

What's the asp.net equivalent to asp's Now()?
I've got a form field where I want to display todays date as default value.

Thanks,

Jerome
 
S

Steven Spits

Jerome said:
What's the asp.net equivalent to asp's Now()?
I've got a form field where I want to display todays date as default
value.

txtDate.Text = DateTime.Today.ToShortDateString();

Steven

- - -
 
G

Guest

The .NET Framework has a DateTime clas

you can get the current time
with the DateTime.Now.ToString()

Hope this help

Yatee
 
K

Kevin Spencer

you can get the current time
with the DateTime.Now.ToString().

Actually, that returns a string, not a DateTime value. Leave off the
..ToString() part and you're there.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top