Skip to content

Commit 8cede37

Browse files
Merge pull request #19 from TakayukiHoshi1984/modify_rfc3339_date_format
Pebbleアプリから返す日付データのフォーマット変更
2 parents cd17d4f + dac6703 commit 8cede37

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

dConnectDevicePebbleApp/src/menu_item.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121

2222
#define FIRST_MENU_TITLE "start App"
23-
#define FIRST_MENU_TEXT "ver 2017/03/01 16:30"
23+
#define FIRST_MENU_TEXT "ver 2017/12/04"
2424
#define MENU_ITEM_MAX 20
2525

2626
static int16_t how_many_item = 0;

dConnectDevicePebbleApp/src/send_message.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,8 @@ void send_message()
3737
char str[64];
3838
// ポインタにしないとTupletCStringがエラーを出す
3939
char *p = str;
40-
int year = local->tm_year + 1900;
41-
int month = local->tm_mon + 1;
42-
int day = local->tm_mday;
43-
int hour = local->tm_hour;
44-
int min = local->tm_min;
45-
int sec = local->tm_sec;
46-
// RFC 3339に合わせて変換を行う
47-
snprintf(str, sizeof(str), "%4d-%02d-%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
40+
// RFC 3339に合わせて変換を行えないため、ISO8601の形式でデバイス側に渡す。デバイス側で変換する。
41+
strftime(str, sizeof(str), "%FT%T%z", local);
4842
entry_log("get setting/date", str);
4943
Tuplet dateTuple = TupletCString(KEY_PARAM_SETTING_DATE, p);
5044
dict_write_tuplet(iter, &dateTuple);

0 commit comments

Comments
 (0)