How do I 'reconnect them back into one 'now' variable?
You "split" the long into a few integers, now you want to re-create the long from those integers. This is what I thought you are looking for.
If the 2-digit numbers are strings (but why would you not save them directly as integers?), then convert them, to integers and perform the same calculation.
In any case, why not save the whole long as a long? In other words, why do you need to split?
unsigned long now=now(); //example if now = 1500500500
buffer[10]=now % 10; // should be 0
buffer[9]=(now/10) % 10; // should be 0
buffer[8]=(now/100) % 10; // should be 5
buffer[7]=(now/1000) % 10; // should be 0
buffer[6]=(now/10000) % 10; // should be 0
buffer[5]=(now/100000) % 10; // should be 5
buffer[4]=(now/1000000) % 10; // should be 0
buffer[3]=(now/10000000) % 10; // should be 0
buffer[2]=(now/100000000) % 10; // should be 5
buffer[1]=(now/1000000000) % 10; // should be 1
Your latest code splits the long into decimal digits.
If you want bytes, should similarly use 256 instead of 10.
If you want hexadecimals, use 16 instead of 10.
I still don't understand why not save it as a long. Saved as a long, read as a long.
Pickydesign:
I will try to save to Mifare as a long, but it saves in bytes, longest being 255. That's why I'm trying to break apart.
If you can save up to 255 bytes, there is no issue. an unsigned long integer is only 4 bytes (on an UNO)
If you can only save a single byte at a time, use a union and write each byte of the time longint one byte at a time.
Figured it out. Used my code above to break up into single digits, write to card as dataBlocks[0-9]
Then read from card and String buffers[0-9] together (backwards)
Then string.toInt and I get the written now() last time card was scanned
Im sure there might be an easier way I will revisit options later. I've been stuck on this for a week and I appreciate the help. On to next problem we go!