#year()

DESCRIPTION
    returns the current year (as a four-digit number)

    or:

    returns the year (as a four-digit number) of the given datevalue
SYNOPSIS
    #year()

    or:

    #year(d)
ARGUMENTS
    none

    or:

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

# pikt +C 'output $text(#year(#now()))'
2007
	rule    // do only in even-numbered years
                if #year() % 2 == 0 && ...
                        ...
                fi
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
                set #timenow = #now()
                set #yr = #year()

        rule
                set #mn = #monthnumber($mon)
                set #msgage = #daysbetween(#datevalue(#yr, #mn, #date), #timenow)
SEE ALSO
    $dayname()
    $monthname()
    #day()
    #daynumber()
    #month()
    #monthnumber()
    #weekday()
    #yearday()
    #yearweek()

    String Functions
    Numerical 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
high zombie
counts
Pikt script