Converts a single starting year into a Stanford academic year format by combining
it with the following year. Takes a year (YYYY
) and returns the full academic
year string (YYYYYYYY
).
Value
Character string. Eight-digit academic year in format YYYYYYYY
where
the first four digits are the start year and the last four digits are
the start year plus one.
Details
The function:
Converts the input year to an integer
Creates an 8-digit string by combining the start year with (start year + 1)
Ensures proper zero-padding of years using
sprintf()
For example:
2023 -> "20232024"
2024 -> "20242025"
See also
validate_academic_year()
for validating academic year stringsfetch_department_courses()
for using academic years in course queries