$monthname()
DESCRIPTION
for the current month, or the given month number (1-12), returns the month name
("January", "February", ...)
SYNOPSIS
$monthname()
or:
$monthname(i)
ARGUMENTS
none
or:
i - an integer, or integer expression, from 1 to 12
EXAMPLES
# pikt +C 'output $monthname()'
June
# pikt +C 'output $monthname(4)'
April
begin
if $monthname() eq "January" && #day() == 1
exec wait "=rollover"
fi
quarter1 ( $monthname() eq "January" || $monthname() eq "February" || $monthname() eq "March" )
quarter2 ( $monthname() eq "April" || $monthname() eq "May" || $monthname() eq "June" )
quarter3 ( $monthname() eq "July" || $monthname() eq "August" || $monthname() eq "September" )
quarter4 ( $monthname() eq "October" || $monthname() eq "November" || $monthname() eq "December" )
rule
output log "=logdir/" . $monthname() . ".log" $inlin
rule // note file name, update time, and whether or not stale
if $left($inlin,1) eq "/"
if #split($inlin) != 5
next
else
set #filhdr = #true()
set #stale = #false()
set $of = $1
set $mn = $2
set $dy = $3
set $hr = $4
set $mt = $5
set #ag = (#hour()*60 + #minute()) - (#val($hr)*60 + #val($mt))
// if prior month or day
if $monthname() !~ $mn
|| #day() != #val($dy)
set #stale = #true()
set $stlout = "maybe stale, last update $mn $dy $hr:$mt"
// else if same day, but more than 15 mins old
elsif #ag > 15
set #stale = #true()
set $stlout = "maybe stale, last update
$mn $dy $hr:$mt, $text(#ag,0) minutes old"
fi
fi
next
fi
SEE ALSO
$dayname()
#day()
#daynumber()
#month()
#monthnumber()
#weekday()
#year()
#yearday()
#yearweek()
Numerical Functions
String Functions