Name
TermCode — A perl module used to provide codes for the current term in various formats
Description
There are several different ways to refer to a given term. This module contains several constants which are used to differentiate the various ways to refer to a term.
- TermCode::FMT_TIME
- Indicates the number of seconds since the epoch as of the first second of the first month of term in local time.
- TermCode::FMT_MFCF
- Indicates the format used for MFCF classlist files.
- TermCode::FMT_REGISTRAR
- Indicates the format used by the Registrar's office, for example in the schedule of classes.
- TermCode::FMT_SHORT
- Indicates a commonly-used short readable form, with a letter for the term within the year followed by a 2-digit year.
- TermCode::FMT_LONG
- Indicates a commonly-used long readable form, with the term within the year, followed by a space, followed by a 4-digit year.
There are two functions available in the module to retrieve particular term codes.
- get_termcode(month, year, format)
- Given a numeric month (0-11) and a fully-specified year as would be returned by the localtime function, returns the code for the term in that month. The format used is determined by the final argument, which must be one of the constants listed above.
- current_termcode(format)
- Works similar to get_termcode, but uses the current month and year automatically.
Topic revision: r1 - 2016-01-11
- YiLee