C Library Functions - mo2v (3)
NAME
mo2v(3f) - [M_time:MONTH_NAME] given month name return month number
(1-12) of that month
(LICENSE:MIT)
CONTENTS
Synopsis
Description
Options
Returns
Example
Author
License
SYNOPSIS
elemental function mo2v(month_name) result(imonth)
character(len=*),intent(in):: month_name ! month name
integer :: imonth ! month number
DESCRIPTION
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.
OPTIONS
|
month_name |
| |
name or abbreviation of month. Case is ignored.
|
|
RETURNS
|
imonth |
month number returned. If the name is not recognized a -1
is returned.
|
|
EXAMPLE
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_mo2v
results:
> 4
> 4
> -1
> -1
AUTHOR
John S. Urban, 2015
LICENSE
MIT
| Nemo Release 3.1 | mo2v (3) | June 29, 2025 |
Generated by manServer 1.08 from d2574ce9-88c1-4287-a663-b509f6d87e16 using man macros.