SO8601是一個時間呈現的格式,具提格是如下所示:yyyy-mm-ddThh:mm:ssZ;其中字元T用來隔開日期和時間;格式最後的部分為時區,時區需顯示正負號,並用字元Z來代表時區為+0(此題無須實作格式)
給定一個名為Time的struct,如下列所示:
再給定主要執行程式main.c (題號.c)、以及Header檔function.h (題號.h);請試著在function.c中,完成Header檔中未實現的函式,使程式能順利運行:GetYear()、GetMonth()、GetDay()、GetHour()、GetMinute()、GetSecond()、GetTimeZone()
Methods:
int GetYear(Time time)
int GetMonth(Time time)
int GetDay(Time time)
int GetHour(Time time)
int GetMinute(Time time)
int GetSecond(Time time)
int GetTimeZone(Time time)
function.c
輸入符合以下格式
Y M D h m s Z
上述變數分別代表年、月、日、小時、分鐘、秒、時區,且皆為整數型別
Note:
無需處理輸入
輸出符合以下格式:
YYYY-MM-DDThh:mm:ssZ
Note:
無需處理輸出