#datevalue()

DESCRIPTION
    returns the date value for the given date (dd/mm/yyyy)
SYNOPSIS
    #datevalue(i1,i2,i3)
ARGUMENTS
    i1 - year (4 digits), or an integer expression resolving to a year
    i2 - month (1-12), or an integer expression resolving to a month
    i3 - day (1-31), or an integer expression resolving to a day
EXAMPLES
# pikt +C 'output $text(#datevalue(2007,6,21))'
1182405600
        rule
                set #msgage = #daysbetween(#datevalue(#yr, #mn, #date), #timenow)
remind(Y, M, D, MSG)
                // send out a reminder message beginning at a certain date
                // (Y) is the year (e.g., 2007)
                // (M) is the month (e.g., 7)
                // (D) is the date (e.g., 15)
                // (MSG) is the message (e.g., "REVIEW DISK QUOTAS")
                if #now() > #datevalue((Y), (M), (D))
                        output mail (MSG)
                fi
        begin
#piktexec "/dev/null" [if #day() == 1 =mailmsg1(review the orphans bypass,
                                                     REMINDER, =piktadmin) fi]
                if #now() < #datevalue(2005, 10, 1)
                        set #bypass_orphans = #true()
                else
                        set #bypass_orphans = #false()
                endif
        rule    // if it's been more than #hrs hours since the last piktd_log
                // entry, piktd is not logging, hence appears to be hung/dead;
                do #split($time, ":")
                set #t = #datevalue(#yrnow - #if(#monnow == 1 && $mon eq "Dec", 1, 0),
                                    #monthnumber($mon),
                                    #date)
                         + #timevalue(#val($[1]), #val($[2]), #val($[3]))
                if #timenow - #t > #hrs*60*60
                        output mail "piktd appears to be hung/dead on $sys"
                endif
SEE ALSO
    #timevalue()
    #hour()
    #minute()
    #now()
    #second()
    #today()

    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
Learn about the
piktd
program