如何使用此代码将日期显示为08/01/18而不是08/01/2018?
DateTime now;
char text1[5];
sprintf(text1, "%02hhu/%02hhu/%04hhu", now.day(), now.month(), now.year());
答案 0 :(得分:0)
感谢Celal,这有效:
DateTime now;
char text1[8];
sprintf(text1, "%02hhu/%02hhu/%04hhu", now.day(), now.month(), now.year()%100);