#day()

DESCRIPTION
    returns the current calendar day (1-31)

    or:

    returns the calendar day (1-31) of the given datevalue
SYNOPSIS
    #day()

    or:

    #day(d)
ARGUMENTS
    none

    or:

    d - a datevalue, or datevalue expression
EXAMPLES
# pikt +C 'output $text(#day())'
20

# pikt +C 'output $text(#day(#today()))'
20
set_datestamp   // set $datestamp = "991215", for example
                set $datestamp = $right($text(#year()),2) .
                                 $if(#month()<10, "0", "") . $text(#month()) .
                                 $if(#day()<10, "0", "") . $text(#day())
        begin
                // according to emy, these accounts are possible no-shows,
                // latecomers, on-leaves-of-absence, or legitimate inactives;
                // see also the orphan rule below and the =mbaorphans file
#piktexec "/dev/null" [if #day() == 1 =mailmsg1(review the mba orphans bypass,
                                                  REMINDER, =piktadmin) fi]
        //      if #now() < #datevalue(2001, 10, 1)
                        set #bypass_mba_orphans = #true()
        //      else
        //              set #bypass_mba_orphans = #false()
        //      endif
        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
    #daynumber()
    #month()
    #monthnumber()
    #weekday()
    #year()
    #yearday()
    #yearweek()
    $dayname()
    $monthname()

    Numerical Functions
    String Functions
 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2019-01-12.   This site is PIKT® powered.
Copyright © 1998-2019 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
View sample
piktc commands