CurrentMonth$
Month$ = CurrentMonth$([Format =0])
 
Parameters:

    [Format =0] = Optional format paremeter for how the month should be returned
Returns:

    Month$ = The name of the current month
 

CurrentMonth$ returns the current month in a string format. The user has some basic format controls to determine the what the function returns. By default the function will return the Month in a threee digit format. So the month November would be returned as "Nov".


     Format Flags

           Format Flag =1 = Month name in 3 digit format (Jan,Feb.. Nov,Dec)
           Format Flag =2 = Month name full (January,February.. November,December)
           Format Flag =4 = Month index (1 to 12)
           Format Flag =8 = Month index 2 digit (01 to 12)



FACTS:


* CurrentMonth$ defaults to returning the month in 3 digit format to remain compatible with older code for PlayBASIC.




Tutorial:


      This example demo's the date functions with various parameter combinations.


  
  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 | CurrentSecond | CurrentTime$ | CurrentYear$ | Timer :
 


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