Arduino如何在08/01/18而不是08/01/2018显示日期?

时间:2018-01-08 22:41:05

标签: datetime arduino

如何使用此代码将日期显示为08/01/18而不是08/01/2018?

DateTime now;
char text1[5];
sprintf(text1, "%02hhu/%02hhu/%04hhu", now.day(), now.month(), now.year());

1 个答案:

答案 0 :(得分:0)

感谢Celal,这有效:

DateTime now;
char text1[8];
sprintf(text1, "%02hhu/%02hhu/%04hhu", now.day(), now.month(), now.year()%100);