-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Prasanna_kakanoor
Message 2 in Discussion
Hi,
I think there is no problem for setting the date format in C#.
Here is the code I tried for printing the date in dd/MM/yyyy format and in browser it
is printing 06/12/2003. Can u check your regional Setting for date format?
private void Button1_Click(object sender, System.EventArgs e)
{
string strDate = "";
strDate = GetDate();
Response.Write(strDate);
}
private string GetDate()
{
System.DateTime obj = new System.DateTime(2003,12,6);
return (obj.ToString("dd/MM/yyyy"));
}
Prasanna K L
[MCAD(CM) | MCSD.NET(Early Achiever)]
ZapApp India Private Limited
Level G & 1, Explorer Building,
International TechPark, Whitefield Road,
Bangalore - 560 066. INDIA
91-80- 5115 6050 extn. 4084 (phone)
91-80- 841 1858 (fax)
[EMAIL PROTECTED]
-----Original Message-----
From: Manikandan [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 06, 2003 4:18 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Date Formatting
New Message on BDOTNET
Date Formatting
Reply
�
Reply to Sender ��Recommend
Message 1 in Discussion
From: Manikandan
I have one property in my class which must return a DateTime value,
but it should return me the date with leading zeroes, that is if the date
is 6th dec then my property should return me 12/06/2003. I tried converting
that using myDate.ToString("MM/dd/yyyy") and since my property should datetime
value I again converted that string to datetime value but after doing the
conversion its returning me "12/6/2003" which I dont want.
�
Can anybody tell me how to format a string in such a way that I will
get with leading zeroes.
�
�
Regards
P.S. Manikandan ,
CGI Information Systems,
Tel: 091-080-8521224 Ext-291,
[EMAIL PROTECTED]
View other groups in this category.
Also on MSN:
Start Chatting�|�Listen to Music�|�House & Home�|�Try Online Dating�|�Daily Horoscopes
Passport Member Services.
For other questions or feedback, go to our Contact Us page.
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
Remove my e-mail address from BDOTNET.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]