语言

Menu
Sites
Language
How to convert String to struct tm

Hi

is it possible to convert string "20161227T100500Z" to struct tm in tizen?

I'm trying to do this using function strptime() but I got error:

error: implicit declaration of function 'strptime' is invalid in C99

if its not possible to convert into tm struct maybe there is a way to convert it to different format like: "YYYY-MM-DD HH:MM:SS"

 

Thanks!

编辑者为: Kamil N 27 12月, 2016
查看选择的答案

响应

1 回复
Mark as answer
Kamil N

I found solution. I used strptime but I had to add 

#define __USE_XOPEN
#define _GNU_SOURCE

before #include <Elementary.h>