hello (سلام مهندس )
how can i convert rtc time to jalali with your cod?
looklike this
include
DS3231_Simple Clock;
///jalali date shamsi
include "JDateLib.h"
String jdate; // Jalali Date String
int JY, JM, JD; // Jalali Year & Month & Day Intiger
String timsd; //use for put time togather and convert to shamsi
int Ytim = "";
int Montim = "";
int Dtim = "";
int Htim = "";
int Mintim = "";
void setup() {
Clock.begin();
}
hello (سلام مهندس ) how can i convert rtc time to jalali with your cod? looklike this
include
DS3231_Simple Clock; ///jalali date shamsi
include "JDateLib.h"
String jdate; // Jalali Date String int JY, JM, JD; // Jalali Year & Month & Day Intiger String timsd; //use for put time togather and convert to shamsi int Ytim = ""; int Montim = ""; int Dtim = ""; int Htim = ""; int Mintim = ""; void setup() { Clock.begin(); }
void readtime() { DateTime MyDateAndTime; MyDateAndTime = Clock.read(); Ytim = (MyDateAndTime.Year); Montim = (MyDateAndTime.Month); Dtim = (MyDateAndTime.Day); Htim = (MyDateAndTime.Hour); Mintim = (MyDateAndTime.Minute);
// conver to jalali timsd +="20"; timsd +=Ytim; timsd +=", "; timsd +=Montim ; timsd +=", "; timsd +=Dtim ;
Date now(2018, 07, 31); Ytim = (MyDateAndTime.Year); Montim = (MyDateAndTime.Month); Dtim = (MyDateAndTime.Day); Htim = (MyDateAndTime.Hour); Mintim = (MyDateAndTime.Minute);
// conver to jalali timsd +="20"; timsd +=Ytim; timsd +=", "; timsd +=Montim ; timsd +=", "; timsd +=Dtim ;
Date now(timsd); jdate = now.JDate(); JY = now.JYear(); JM = now.JMonth(); JD = now.JDay(); //Serial.println(JY); //Serial.println(JM); //Serial.println(JD); Serial.println(jdate); } void loop () { readtime(); }