tags:

views:

216

answers:

1

i send any function a datetime is_PM_AM("23:00.00") if it is pm ,it must be return true or else? But how? mytime ="23:30:00"

function(Datetime mytime) {
    if (Datetime.midnight < mytime) {
        return true;
    } else
        return false;
}

Can you help me?

+3  A: 
public bool IsTimePM(DateTime mytime)
{
    return (mytime.Hour >= 12 && mytime.Hour < 24);
}

also see wikipedia - 12-hour clock

Max Gontar