how to get date in "dd/mm/yyyy" using


I have  textbox, while page loads, by default this texbox need to be with today's date in "dd/mm/yyyy"  format...

Can anyone suggest how to do this using



Thanks and Regards
11/25/2008 9:38:20 AM 91979 articles. 4 followers. Follow

10 Replies

Similar Articles

[PageSpeed] 36

    <form id="form1" runat="server">
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>




 protected void Page_Load(object sender, EventArgs e)
        TextBox1.Text = DateTime.Now.ToString("dd/MM/yyyy");

Hope it helps.


If this post is useful to you, please mark it as answer.
11/25/2008 11:04:24 AM

well can u use datetimepicker for it?


just try... I had taken it from other reference material... credit goes to that unknown author of this code...

dd/mm/yyyy Format In regular Expression (optional mm,optional dd)
([1-9]|0[1-9]|[12][0-9]|3[01])[- /.]([1-9]|0[1-9]|1[012])[- /.][0-9]{4}$

mm/dd/yyyy (optional mm,optional dd)
^([1-9]|0[1-9]|1[012])[- /.]([1-9]|0[1-9]|[12][0-9]|3[01])[- /.][0-9]{4}$

mm/dd/yyyy (Exact Format)



11/25/2008 11:04:50 AM

 in design mode specify the textbox text as like this

<%= String.Format("{d}", DateTime.Now) %>

Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
11/25/2008 11:08:26 AM


Very simple...

DateTime.Now.ToString ("dd/MM/yyyy");




11/25/2008 11:09:10 AM


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

11/25/2008 11:20:47 AM

 try this:-

txtbox.Text = DateTime.Now.ToShortDateString();

11/25/2008 11:22:43 AM



 Page_Load() event write below code

 TextBox.Text = Convert.ToString(DateTime.Now);



Thanks & Regards

Sandeep Reddy Pasham

GGK Technologies , HYD

Thanks & Regards
Sandeep Reddy Pasham
GGK Technologies, Hyd
~ Please remember to click Mark as Answer on this post if it helped you ~
11/25/2008 11:23:49 AM

With the ToString() method it's very simple.

txtDate.Text = DateTime.Now.ToString("dd/MM/yyyy");


11/25/2008 11:29:37 AM

Hi Friend,

Try This  it easy

DateTime.Now.ToString ("dd/MM/yyyy");


Dont Forget to Mark 'ANSWERED' if it helped u
11/25/2008 11:43:26 AM


It works perfect for me."dd/MM/yyyy");

12/13/2008 6:00:47 AM

Similar Artilces:

Developed WebService 1.1 for Client 1.1. Getting error "Server was unable to process the Request" Pls Help
Hi., I developed Microsoft Web Services2003 for the Client Application 2003. When it runs in 5 machines it gives good performance and has no errors. But if i run the same application in about 80 client machines. Getting error "Server was unable to process the request". I use Sql Server 2005 as my database. I get error even when i login at a time for about 25 users. Tried modifying machine.config too. But went unsuccessful. Live Server is 2003 using IIS 6.0 I use very expensive data handling.  Its very urgent pls help. Have to post in Live Server. Thank u., ...

Keep getting..."Unable to get project file from server",when using
When trying to open any existing project in Visual Studio it keeps giving me the message above. It is also throwing an error when I create the project in the first place, it happens when a dos window is opened, the text in the dos window is running "Common Language Runtime Minidump Utility version 1.0.3705.0" and then VS craps out says there was an error and shuts down. I've re-installed the .net components and framework with no avail, and FrontPage extensions etc.. are all installed. I'm running XP professional and have installed IIS 5.1. This is driving me fec...

C#.Net "Double" and "double" When/Where to use?
Hi all     Please let me know the difference between "Double" and "double" in c#.Net (I understand that "Double" is structure      and "double" is an instance to that structure) differences if any thing else.     Also the context in which both has been used.(When/Where to use both). thanks all...      hi,my brains says Double is reference type & double is value type.regards,satishKind Attn: If a reply to your post helped you, kindly mark it as Answered.__________...

Get "Mail"/"Get "News" / "Write"/"Post" buttons?
If the "Get Mail" button text changed to "Get News", and "Write" changed to "Post" when TB's in the news-reading mode, it would save me and probably others from constantly forgetting to make the change before proceeding. :-) Or is there an extension to do this which I don't know about? Thanks! Bob Bob P wrote: > If the "Get Mail" button text changed to "Get News", and "Write" > changed to "Post" when TB's in the news-reading mode, it would save me > and probably others...

Hide "NET USE" C:\Windows\System32\net.exe prompt
--____HXVYWAWXUSKEVXKBAEOI____ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable On our logon script I'm currently mapping NetWare shares using the MAP = command and Windows shares using the NET USE command. Everything is = working fine and well its just that I'd like to completely hide the = windows command prompt box at login. Close as I've come to a recommendation= was to minimize it but not to completely hide it. as a example of what I'm currently doing: @CMD /C START /M NET USE R: = \\servername\sharename "@C...

Getting an "Unknown runtime error" when using Sys.Net.WebRequest
Hi,I'm trying to use Sys.Net.WebRequest to implement incremental page display (as described in this video: Basically, I'm trying to inject the HTML from one aspx page into a div on another aspx page.The page request works just fine, but when I try to set the div's innerHTML to the value returned by get_responseData(), I'm getting an "Unknown runtime error". I found a forum post that suggested that this might be due to adding a second form tag to the page, but this wasn't a problem in the video I linked to abo... get FirstName, LastName using "userprofileservice.asmx"
  Dear All, I am new for and I was trying this link and its work well Is that possible to use (Web references) http://serverxxx/_vti_bin/userprofileservice.asmx?wsdl and get FirstName, LastName, Office, Email... from Active Directory as well. I am using Infopath to get those details, But wanna try using to do that. Thanks Lasantha...

What is the use of "Get" and "Set" and how it works?
I'm trying to figure out one part of the code which I found for paging. After looking at them and search other articles about this, I still couldn't understand how this "Get" and "Set" works. Can someone provide me a simple explaination how it works and why we need it? Thanks.1 Public Property CurrentPage() As Integer 2 Get 3 Dim o As Object = ViewState("_CurrentPage") 4 5 If o Is Nothing Then 6 Return 0 7 Else 8 Return o 9 End ...

does anyone know how i would get <%#Eval("Date", "{0:dddd dd MMMM yy}")%>...
to show TUES 21 AUGUST 07 instead of  Tuesday 21 August 07. Thanks Hi There, Try following: <%#Eval("Date", "{0:ddd dd MMMM yy}")%>... More information:'t forget to click "Mark as Answer" on the post that helped you. This credits that member, earns you a point and marks your thread as Resolved.  <%#Eval("Date", "{0:ddd dd MMMM yy}").ToUpper%>Regards Mike [MVP - ASP/ASP.NET]My site...

"Get Mail" vs "Get All New Messages"
I have a few different email accounts set up in Thunderbird, and I'm using the unified view to view them. Recently, I noticed that the "Get Mail" button seems to only retrieve email for the first account (sometimes?). I'd like to click on that button and retrieve email for all of the accounts. I can get the behavior that I want consistently if I pull down the menu for "Get Mail" and select "Get All New Messages", but I'd prefer to get that in a single click if possible. I tried starting from scratch and recreating my profile, but I st...

Feature Request: "Get Extensions" and "Get Themes"
I think that when you click on the "Get Extensions" or "Get Themes" links, it should open depending on your default window-opening behavior. For example, all new windows for me open up in new tabs. However, when I click the "Get" links, they always open in new windows. I can't even find an extension to do this. How hard would this be to incorporate natively? ...

error "Failed to get datetime data" using 1.0.1
Hello, My situation: I have a vs2005 project with version 1.0.1 (build 5502), database is asa10. When my regional settings are Dutch(Belgium) I have no problems at all. When the settings are Italian(Italy) I get a "Failed to get datetime" error when I retrieve when my data contains dates. When the date fields are not filled in then I do not get the error. A date of '2008-1-1 08:00:00' also gives errors. When I try to retrieve the same data in the datawindow painter I also get no error. Can anyone help me? Greetings, Mich=E8le 2.5 is now th...

MaskedEditExtender date format problem ("yyyy-MM-dd" with cultureName="sv-SE" doesn't work)
Hi All, I need to create MaskedEditExtender for Sweden date which uses format "yyyy-MM-dd". I have the following code below. CalendarExtender doesn't work with current MaskedEditExtender. Also the validation doesn't work properly. <asp:TextBox ID="txtFSFV" MaxLength="100" style="width:70px" runat="server" /> <asp:HyperLink ID="hplGetCalendar" NavigateUrl="javascript:void(null)" runat="server"> <img src="~/images/calendar.png" runat...

Whan can i do? make "string" data type convert to "window" data type, and use a "window" name to get it ancestor "window name", thanks! i use pb5
Rich, With a string window name, you can open a window of that type if you need to. You could, of course, query that window object for any attributes. Another option is to use the LibraryExport function to export the definition of the window which is specified by the string. You can then parse the resulting file to get information on the ancestor object. HTH Sanjiv. "Rich" <> wrote in message > > > ...

Web resources about - how to get date in "dd/mm/yyyy" using -

Resources last updated: 1/23/2016 9:34:56 AM