خرید بک لینک

Vote count: 0

I've a string as: 1459791437 and I want to transform it in this format: YYYYMMDD,HH. I don't how to convert that string in a struct tm, I need that conversion to use the function: strftime.

Here you can see what I want to do:

void find_date(long timestamp, int *date, int *hour){
    char buf[20];
    struct tm *time_struct = magic_function(timestamp);
    strftime(buf, sizeof(buf), "%Y%m%d,%H", time_struct);
    printf("Time: %s", buf);
}

What I caot do is the struct tm *magic_function(long);, could anyone help me?

asked 29 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 17 فروردين 1395 ساعت: 4:22

صفحه بندی