Timesquare date format

Tick Tock Clock Kits

Moderators: adafruit_support_bill, adafruit

Timesquare date format

Postby guillermo3r » Tue Mar 12, 2013 2:39 am

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.
guillermo3r
 
Posts: 17
Joined: Wed Sep 23, 2009 2:42 am

Re: Timesquare date format

Postby pburgess » Tue Mar 12, 2013 1:36 pm

Howdy!

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];
    }

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:
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];
    }
User avatar
pburgess
 
Posts: 1339
Joined: Sun Oct 26, 2008 1:29 am

Re: Timesquare date format

Postby guillermo3r » Tue Mar 12, 2013 2:45 pm

Thanks for your rapid response :D
guillermo3r
 
Posts: 17
Joined: Wed Sep 23, 2009 2:42 am


Return to Clocks

Who is online

Users browsing this forum: No registered users and 1 guest

Stuff to buy from the Adafruit store and links to product documentation!


New Products [103]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[109]
 
Wireless[14]
Cables[61]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]