CurrentYear$
Year$ = CurrentYear$([Format =0])
 
Parameters:

    [Format =0] = Optional format flag for how the Year string should be returned
Returns:

    Year$ = The name of the current year
 

      The CurrentYear$() function returns the current year in a string format. The function includes an optional parameter to choose the formating of the returned text. Which defaults to four digit format.


     Format Flags

           Flag 1 = Four digit year
           Flag 2 = Two digit year



FACTS:


* CurrentYear$ defaults to returning the month in 4 digit format to remain compatible with older PlayBASIC code.



Tutorial:




  
  Print "-[DAY]---------------------------------"
  Print CurrentDay$()               ; defaults to Day of the month index 2 digit
  
  Print CurrentDay$(1+4+16)
  Print CurrentDay$(1)               ; Day of the week name
  Print CurrentDay$(2)               ; Day of the week name 3 digit
  Print CurrentDay$(4)               ; Day of the month index variable digit
  Print CurrentDay$(8)               ; Day Of the month index 2digit
  Print CurrentDay$(16)          ; Suffix for the day of the month
  Print ""
  Print ""
  
  Print "-[MONTH]--------------------------------"
  
  Print CurrentMonth$()          ; Defaults to three digit month name
  Print CurrentMonth$(1)          ; Month name in three digit.
  Print CurrentMonth$(2)          ; Month name full
  Print CurrentMonth$(4)          ; Month index variable length
  Print CurrentMonth$(8)          ;
  Print ""
  Print ""
  
  
  Print "-[YEAR]--------------------------------"
  Print CurrentYear$()               ; Defaults to Four digit Year string
  Print CurrentYear$(1)          ; Two digit year string
  Print CurrentYear$(2)          ; Four digit year string
  
  Print ""
  Print ""
  
  Print "-[EXAMPLES]-----------------------------"
  
  Print CurrentDay$(1+4+16)+" of "+CurrentMonth$(1)+","+CurrentYear$()
  
  Print ""
  
  Sync
  WaitKey
  
  
  
  



Sample Output:

  
  -[DAY]---------------------------------
  12
  Monday 12th
  Monday
  Mon
  12
  12
  th
  
  
  -[MONTH]--------------------------------
  Oct
  October
  Oct
  10
  10
  
  
  -[YEAR]--------------------------------
  2015
  15
  2015
  
  
  -[EXAMPLES]-----------------------------
  Monday 12th of October,2015
  
  





 
Related Info: CurrentDate$ | CurrentDay$ | CurrentHour | CurrentMinute | CurrentMonth$ | CurrentSecond | CurrentTime$ | Timer :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com