interesting fact about date.

G

Guest

hi

I have not seen anything yet that can help me with this.

All the time my page is loaded I need to show inside a TextBoxt the first
day of the month:

If the page is being loaded this month the textboxt should have

06/01/2005

If the page is being loaded the next month the textboxt should have

07/01/2005

If the page is being loaded at december:

12/01/2005

any sug?
 
G

Guest

Depending on your needs, you could try setting the Text of the TextBox to a
serialized string that you make. Grab the Month and Year parts of the
current month and put '/01/' between them and assign that string to the Text
property.

This may not work as well if you have a localized app where user format
settings take effect. Is this the case?

HTH,
-Ryan
 
W

WJ

int d=(DateTime.Now.Day-1)*-1; //today-1
DateTime date1=DateTime.Now.AddDays(d); //move back d days
txt1stDayOfMonth.Text="1st Day: "+string.Format("{0:MM/dd/yyyy}",date1);
//show it

Is that what you want ?

John
 

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
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top