Sign up ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

For some reason I can't use the Time.h lib.

Can you guys tell me how to create a string from the datetime into a format like this: "yyyy.MM.dd:hh.mm.ss" 2014.10.29:07.12.33

Seems odd that I can't find any examples of this.

Thank you. Terrence

share|improve this question
    
That's because they all just print it. –  Ignacio Vazquez-Abrams Oct 30 '14 at 2:28

1 Answer 1

There's no built in function to do that, I'm afraid.

I suggest you create a method that will format the string like so. Something along the lines of:

void formatTime()
{
   string str = year() + "." + month() + "." + day() + ":" + hour() + "FILL IN THE REST";
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.