Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. /*
  2. * RTC_Time.h
  3. * 27-02-2017 07:32
  4. */
  5. String form(int value){
  6. String result = String(value);
  7. if (value<10){
  8. return result = "0"+result;
  9. }
  10. return result;
  11. }
  12.  
  13. String DayOfWeek(int n){
  14. const String Days[]={"Mn","Tu","We","Th","Fr","Sa","Sn"};
  15. return Days[n-1];
  16. }
  17.  
  18. String Time2Str(void)
  19. {
  20. myRTC.updateTime();
  21.  
  22. String result =
  23. form(myRTC.dayofmonth)+"/"+
  24. form(myRTC.month)+"/"+
  25. form(myRTC.year)+" "+
  26. form(myRTC.hours)+":"+
  27. form(myRTC.minutes)+"."+
  28. form(myRTC.seconds);
  29.  
  30. return result;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement