Hi to everybody,
I would like to change the date display format from MM/DD/YY to DD/MM/YY
Can anybody tell me what changes should I make on the code to achive this?
Thanks
Guillermo.
Timesquare date format
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Timesquare date format
Howdy!
Let's see...in examples/Watch/Marquee.pde, look for this block starting around line 207:
The code here is piecing together a date string which is later used for reference to 'blit' a set of bitmaps to the display. Just need to switch a few lines around to put the day first:
Let's see...in examples/Watch/Marquee.pde, look for this block starting around line 207:
Code: Select all
} else {
loadDigits(now.year() - 2000, DIGIT_YEAR0);
loadDigits(now.month() , DIGIT_MON0);
loadDigits(now.day() , DIGIT_DAY0);
if(digit[DIGIT_MON0] > 0) str[len++] = digit[DIGIT_MON0];
str[len++] = digit[DIGIT_MON1];
str[len++] = SYM_SLASH;
if(digit[DIGIT_DAY0] > 0) str[len++] = digit[DIGIT_DAY0];
str[len++] = digit[DIGIT_DAY1];
str[len++] = SYM_SLASH;
str[len++] = digit[DIGIT_YEAR0];
str[len++] = digit[DIGIT_YEAR1];
}
Code: Select all
} else {
loadDigits(now.year() - 2000, DIGIT_YEAR0);
loadDigits(now.month() , DIGIT_MON0);
loadDigits(now.day() , DIGIT_DAY0);
if(digit[DIGIT_DAY0] > 0) str[len++] = digit[DIGIT_DAY0];
str[len++] = digit[DIGIT_DAY1];
str[len++] = SYM_SLASH;
if(digit[DIGIT_MON0] > 0) str[len++] = digit[DIGIT_MON0];
str[len++] = digit[DIGIT_MON1];
str[len++] = SYM_SLASH;
str[len++] = digit[DIGIT_YEAR0];
str[len++] = digit[DIGIT_YEAR1];
}
- guillermo3r
- Posts: 17
- Joined: Wed Sep 23, 2009 3:42 am
Re: Timesquare date format
Thanks for your rapid response
Please be positive and constructive with your questions and comments.