🔒 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
  • 639
    Views
  • 3
    Participants
Last reply from:
m0stwanted143

Online now

Members online
513
Guests online
915
Total visitors
1,428

Forum statistics

Threads
2,275,071
Posts
28,960,449
Members
1,233,568
Latest member
Watchinnm
Back
Top