The datediff() function is your friend. It’s pretty tolerant to all kinds of dates and times. You can comment/uncomment the set @now lines to suit your testing needs.
%%[
var @now, @hourdiff
set @now = now()
set @now = "10:00 PM"
set @now = "6:01 AM"
set @now = "13:01"
set @hourdiff = datediff("00:00",@now,"H")
set @greeting = ""
if @hourdiff >= 0 and @hourdiff <= 12 then set @greeting = "Good Morning!" elseif @hourdiff > 12 and @hourdiff <= 17 then
set @greeting = "Good Afternoon!"
else
set @greeting = "Good Evening!"
endif
]%%
now(): %%=now()=%%
@hourdiff: %%=v(@hourdiff)=%%
@greeting: %%=v(@greeting)=%%
var @now, @hourdiff
set @now = now()
set @now = "10:00 PM"
set @now = "6:01 AM"
set @now = "13:01"
set @hourdiff = datediff("00:00",@now,"H")
set @greeting = ""
if @hourdiff >= 0 and @hourdiff <= 12 then set @greeting = "Good Morning!" elseif @hourdiff > 12 and @hourdiff <= 17 then
set @greeting = "Good Afternoon!"
else
set @greeting = "Good Evening!"
endif
]%%
now(): %%=now()=%%
@hourdiff: %%=v(@hourdiff)=%%
@greeting: %%=v(@greeting)=%%
Output:
now(): 7/2/2015 1:22:07 PM
@hourdiff: 13
@greeting: Good Afternoon!
@hourdiff: 13
@greeting: Good Afternoon!