How to add 30 days to date and display color based on dateAbdalla Elawad10yAsked Sep 2, 2016, 11:49 PM EDT12 answersShareLinkedInXCopy linkSavePlease see picture below and help me pls
How to add 30 days to date and display color based on dateAbdalla Elawad10yAsked Sep 2, 2016, 11:49 PM EDT12 answersShareLinkedInXCopy linkSavePlease see picture below and help me pls
Midhun TpRank #388 · 6.5K reputation10y agoPosted Sep 3, 2016, 12:30 AM EDT0Hi,Your question is not clear. You just need to add 30 days to current day?0
Abdalla ElawadRank #1,443 · 1.1K reputation10y agoPosted Sep 3, 2016, 12:36 AM EDT0Hi Midhunyes but not calculate by Function date because i will enter last date and today , i mean that any date0
Abdalla ElawadRank #1,443 · 1.1K reputation10y agoPosted Sep 3, 2016, 12:56 AM EDT0how to add days to any date ??0
Midhun TpRank #388 · 6.5K reputation10y agoPosted Sep 3, 2016, 1:00 AM EDT0Hi,Try below code - string dateInString = "05/27/2016"; DateTime startDate = DateTime.Parse(dateInString); DateTime expiryDate = startDate.AddDays(30);0
Abdalla ElawadRank #1,443 · 1.1K reputation10y agoPosted Sep 3, 2016, 1:29 AM EDT0Hi Midhunyour code not running i need code working like this / see below Picthanks0
Midhun TpRank #388 · 6.5K reputation10y agoPosted Sep 3, 2016, 1:59 AM EDT0Hi,I haven't understood the logic behind the colors. Please try this code - string yourdate = "02/11/2016"; yourdate = DateTime.ParseExact(yourdate, "dd/MM/yyyy", null).ToString("MM/dd/yyyy"); DateTime startDate = DateTime.Parse(yourdate); DateTime endDate = startDate.AddDays(30); if (DateTime.Now.AddDays(1).ToString("MM/dd/yyyy") == endDate.ToString("MM/dd/yyyy") || DateTime.Now.ToString("MM/dd/yyyy") == endDate.ToString("MM/dd/yyyy")) { Label1.BackColor = Color.Red; } else { Label1.BackColor = Color.Yellow; }0Abdalla ElawadRank #1,443 · 1.1K reputation10y agoPosted Sep 3, 2016, 10:16 PM EDT0Good Morning MidhunBy Simply , i need to add (30 days)to TextBox1if entering any date to TextBox20Abdalla ElawadRank #1,443 · 1.1K reputation10y agoPosted Sep 3, 2016, 10:18 PM EDT0We Can Use AutoPostBack0Midhun TpRank #388 · 6.5K reputation10y agoPosted Sep 3, 2016, 11:05 PM EDT0Hi, i think you can use the code provided by me. Just change string yourdate=Textbox2.Text;0Abdalla ElawadRank #1,443 · 1.1K reputation10y agoPosted Sep 3, 2016, 11:44 PM EDT0hi MidhunNo run your code , are you understand what did i need ?i have tow textbox okitextbox1 is strart date (any date not current date)textbox2 is end date ( calculate automatically in autopostback add 30 days ) only based on date in textbox20Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign inKnow the answer?Answer a question in the forums and earn +20 SHARP for every answer.See unanswered questionsForumsTop experts01Arun PottiAnswers in the forums20answers02Tahir AnsariAnswers in the forums5answers03Kamlesh KumarAnswers in the forums5answers04Sam HobbsAnswers in the forums4answers05Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.JoinFull leaderboard →2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Abdalla ElawadRank #1,443 · 1.1K reputation10y agoPosted Sep 3, 2016, 10:16 PM EDT0Good Morning MidhunBy Simply , i need to add (30 days)to TextBox1if entering any date to TextBox20
Abdalla ElawadRank #1,443 · 1.1K reputation10y agoPosted Sep 3, 2016, 10:18 PM EDT0We Can Use AutoPostBack0
Midhun TpRank #388 · 6.5K reputation10y agoPosted Sep 3, 2016, 11:05 PM EDT0Hi, i think you can use the code provided by me. Just change string yourdate=Textbox2.Text;0
Abdalla ElawadRank #1,443 · 1.1K reputation10y agoPosted Sep 3, 2016, 11:44 PM EDT0hi MidhunNo run your code , are you understand what did i need ?i have tow textbox okitextbox1 is strart date (any date not current date)textbox2 is end date ( calculate automatically in autopostback add 30 days ) only based on date in textbox20
Midhun TpRank #388 · 6.5K reputationPosted Sep 3, 2016, 12:30 AM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Sep 3, 2016, 12:36 AM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Sep 3, 2016, 12:56 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Sep 3, 2016, 1:00 AM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Sep 3, 2016, 1:29 AM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Sep 3, 2016, 1:46 AM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Sep 3, 2016, 1:46 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Sep 3, 2016, 1:59 AM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Sep 3, 2016, 10:16 PM EDT
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Sep 3, 2016, 10:18 PM EDT
Midhun TpRank #388 · 6.5K reputationPosted Sep 3, 2016, 11:05 PM EDT
string yourdate=Textbox2.Text;
Abdalla ElawadRank #1,443 · 1.1K reputationPosted Sep 3, 2016, 11:44 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts