🔒 Closed How to if condition date.time

Status
Not open for further replies.

m0stwanted143

Eternal Poster
Mga ka phcorner
Paano po ung
If (time 0 > 10:30)
{
Combobox.itemlist = "10:30am, 2:00pm, 4:30";
else if (time 10 30 > 2pm)
{
Combobox.itemlist = "2:00pm, 4:30pm";
{
else if (time 10 30 > 2pm)
{
Combobox.itemlist = " 4:30pm";
 
var timeNow= DateTime.Now;

ComboBox.Items.Clear();

if(timeNow.Hour>0&&timeNow.Hour<10&&timeNow.Min<30)
{
ComboBox.Items.Add(new DateTime(0,0,0,10,30,0).ToShortTimeString());
ComboBox.Items.Add( new DateTime( 0, 0, 0, 14, 0, 0 ).ToShortTimeString());
ComboBox.Items.Add(new DateTime(0, 0, 0, 16, 30, 0).ToShortTimeString());
}
else if(timeNow.Hour>10&&timeNow.Minute>30&&timeNow.Hour<14)
{
//place combobox items here tignan mo nalang ung sa 1st
}

d ko alam ung condition sa last kase same sa 2nd condition.
 
var timeNow= DateTime.Now;

ComboBox.Items.Clear();

if(timeNow.Hour>0&&timeNow.Hour<10&&timeNow.Min<30)
{
ComboBox.Items.Add(new DateTime(0,0,0,10,30,0).ToShortTimeString());
ComboBox.Items.Add( new DateTime( 0, 0, 0, 14, 0, 0 ).ToShortTimeString());
ComboBox.Items.Add(new DateTime(0, 0, 0, 16, 30, 0).ToShortTimeString());
}
else if(timeNow.Hour>10&&timeNow.Minute>30&&timeNow.Hour<14)
{
//place combobox items here tignan mo nalang ung sa 1st
}

d ko alam ung condition sa last kase same sa 2nd condition.
Ako na bahala paps. Salamat sa info. 😊 gagayahin ko na lng ung code mo sa 2nd condition sa 3rd ko .. Hahaha di ko kasi nakita dapat 2 to 4 30 pm yan alam ko
 
Status
Not open for further replies.

About this Thread

  • 4
    Replies
  • 658
    Views
  • 3
    Participants
Last reply from:
m0stwanted143

Trending Topics

Online now

Members online
1,167
Guests online
2,092
Total visitors
3,259

Forum statistics

Threads
2,288,636
Posts
29,053,081
Members
1,214,213
Latest member
smigg
Back
Top