PartofDay $identifier

By gooshie on Aug 10, 2009

Simple $identifier to return the part of a day as in morning,
afternoon, evening or night. Use $partofday(greet) in a greeting
to avoid saying "Good night" to someone you are greeting. No
special effort was made to try to render traditional divisions of
the day instead the day was divided into four equal six hour parts.

Image

; //echo $partofday(greet)
; if greeting and night say good evening

alias PartofDay {
  var %h $asctime(H)
  if %h isnum 12-17 { %h = afternoon }
  elseif %h > 17 { %h = evening }
  elseif %h < 6 {
    %h = night
    if $1 = greet { %h = evening }
  }
  else { %h = morning }
  return %h
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.