Home All Groups Group Topic Archive Search About

Put the date of today in a text control

Author
11 Feb 2007 9:00 AM
Pasquale
I need to create a ASP.NET page that shows in a text control the date of
today (without time) in the format dd/mm/aaaa (the server-client language is
italian) when the page is loaded.

How can I solve this issue?

Thanks

Author
12 Feb 2007 2:43 PM
Stefan Kalcher
Pasquale schrieb:
> I need to create a ASP.NET page that shows in a text control the date of
> today (without time) in the format dd/mm/aaaa (the server-client language is
> italian) when the page is loaded.
>
> How can I solve this issue?

Use the datetime.toString()-method: [1]

[code]
datetime.now.toString("dd/MM/yyyy")
[/code]

greets,
Stefan

[1]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemglobalizationdatetimeformatinfoclasstopic.asp

--
Stefan Kalcher

Programming's just like sex, one mistake, you support it for life.
Author
12 Feb 2007 2:45 PM
Stefan Kalcher
Stefan Kalcher schrieb:
> Pasquale schrieb:
>> I need to create a ASP.NET page that shows in a text control the date of
>> today (without time) in the format dd/mm/aaaa (the server-client language is
>> italian) when the page is loaded.
>>
>> How can I solve this issue?
>
> [code]
> datetime.now.toString("dd/MM/yyyy")
> [/code]

With a textbox:

[code]
txtDate.text = datetime.now.toString("dd/MM/yyyy")
[/code]

greets,
Stefan

--
Stefan Kalcher

Programming's just like sex, one mistake, you support it for life.