mo2v(3f) - [M_time:MONTH_NAME] given month name return month number (1-12) of that month (LICENSE:MIT)
Synopsis
Description
Options
Returns
Example
Author
License
elemental function mo2v(month_name) result(imonth)
character(len=*),intent(in):: month_name ! month name integer :: imonth ! month number
Given a string representing the name or abbreviation of a Gregorian Calendar month return a number representing the position of the month in the calendar starting with 1 for January and ending with 12 for December.
month_name name or abbreviation of month. Case is ignored.
imonth month number returned. If the name is not recognized a -1 is returned.
Sample program:
program demo_mo2v use M_time, only : mo2v implicit none write(*,*)mo2v("April") write(*,*)mo2v(Apr) write(*,*)mo2v(sexember) write(*,*)mo2v(unknown) ! returns -1 end program demo_mo2vresults:
> 4 > 4 > -1 > -1
John S. Urban, 2015
Nemo Release 3.1 | mo2v (3) | February 23, 2025 |