Re: [问题] 已知UTC时间 转换时区的计算方式

楼主: stupid0319 (征女友)   2021-10-28 18:28:46
C的时间处理很麻烦,我有做自己的一包code来处理时间
https://github.com/stupid0319/moment
参考看看
#include <stdio.h>
#include "moment.h"
int main(void) {
Moment * pmo = Moment_Parse("2021-10-27T23:03:00Z");
Moment_Set_utcOffset(pmo, 28800);
printf("%s\n", Moment_Format(pmo, "YYYY-MM-DDTHH:mm:ssZZ"));
Moment_Clear(pmo);
return 0;
}
////////////////////////////////////////////////////
./main
2021-10-28T07:03:00+0800
作者: alloc (韭菜)   2021-10-28 20:22:00
感谢回复

Links booklink

Contact Us: admin [ a t ] ucptt.com