Extracting time from timestamp
问题 I'm trying to extract the time section from an ISO8601 timestamp. e.g. From the following timstamp "0001-01-01T17:45:33" I want to extract this part "17:45:33" . 回答1: you have a few options. lets say you have it in a variable char array called string . now if you know that it the time will always be at the end of the string it`s very easy you can just do: #define TIMEWIDTH 8 #include <stdio.h> #include <string.h> int main() { const char string[] = {"0001-01-01T17:45:33\0"}; unsigned int