10.3.18 getMonth (gets month from date)
Syntax
getMonth [date]
Description
This command outputs the month of the date specified for argument with 2-digit character string (numeric characters). If the argument is omitted, the current date is assumed.
Arguments
- date
-
This command specifies the character string indicating date.
You can specify a date by using an absolute date in the same syntax as when using the date command (examples: yyyy/mm/dd, yyyy-mm-dd, yyyymmdd, mm/dd/yyyy).
Output to the standard output
2-digit character string indicating month (numeric characters)
Return codes
Return code |
Meaning |
---|---|
0 |
Normal termination |
Not less than 1 |
Termination with an error |
Notes
Although the character strings that can be specified for the date are absolute dates as specified in the same syntax as when using the date command, whether the character string is specifiable is not verified.
Examples
getMonth 2016/05/02 # "05" is output.