10.3.16 getHour (gets hour from time)
Syntax
getHour [time]
Description
This command outputs the hour of the time specified for the argument with a 2-digit character string (numerics) from 00 to 23. If this argument is omitted, the current time is assumed.
Arguments
- time
-
This command specifies the character string indicating the time.
The syntax of the time with an absolute date in the date command can be specified for time (Example: hh:mm:ss, hhmm).
Output to the standard output
2-digit character string that indicates the hour (numerics)
Return codes
Return code |
Meaning |
---|---|
0 |
Normal termination |
Not less than 1 |
Termination with an error |
Notes
Although the character string that can be specified for the time is the same as that of the date format based on the absolute date with the date command, whether the character string can be specified will not be verified.
Example
getHour 15:20:01 # "15" is output.