Author Options:

arduino uno programe Answered

i am new to arduino programing and have below query.
i am getting below content in abc and wanted to parse and compare with current time.

char abc[128] = Fajr5,04:40 Sunrise6,06:03 Dhuhr13,12:39 Asr17,17:16 Sunset19,19:15 Maghrib19,19:15 Isha21,20:37 ;

how do we parse and get something

    String time[] = 04:40 06:03 12:39 17:16 19:15 20:37 ;

and then split and compare with current time. i am getting time from ds3231, hh=hour and mm=minute then compare like below

    int h = time.Split(' ')[0].Split(':')[0]; // this is 04
    int m = time.Split(' ')[0].Split(':')[1]; //this is 40

    if(hh== h && mm==m)