Get date and time with V2

Do you know how to get date and time with blynk V2 without RTC module ?

Old RTC widget doesn’t work

OK , I answer to myself
better use NTPClient

Sorry how did you get this working. I also had Date and time working on the old app but can’t work out how to display current date and time on the new app?

1 Like

@vshymanskyy please advise.

1 Like

I use NTPtimeESP lib from the guy with the Swiss accent :stuck_out_tongue_winking_eye:

void GetTime() {

  dateTime = NTPfr.getNTPtime(1.0, 1);

  // check dateTime.valid before using the returned time
  // Use "setSendInterval" or "setRecvTimeout" if required

  if (dateTime.valid) {

    my_h = MyPrintDigits(dateTime.hour);
    my_m = MyPrintDigits(dateTime.minute);
    my_s = MyPrintDigits(dateTime.second);
    my_D = MyPrintDigits(;
    my_M = MyPrintDigits(dateTime.month);
    String Weekday = dayAsString(dateTime.dayofWeek);
    Time = my_h + ":" + my_m + ":" + my_s;
        Blynk.virtualWrite(V2, Weekday + " " + my_D + " " + my_M);
        Blynk.virtualWrite(V1, Time);


Fantastic Thank you

1 Like

I think it should work. You just don’t need to put an actual widget on the dashboard, the functionality is enabled by default.


Try this

I might be missing something here but I can’t see the rtc widget listed in the widget box. Is this the issue?
I should clarify that I am using the static authentication token set-up, not full Edgent.



Yes but you have to use an external library to convert Unix timestamp to hour min sec and date or I’m wrong :thinking:
Thanks the guy with the swiss accent, his library do the job with one line code :joy:

Doh :hot_face: send me back to reading school

1 Like

Maybe I am wrong :joy:
But the actual documentation don’t explain how to get real human time :joy:
Hour() is not available !

You can still use WidgetRTC.h

1 Like

I was looking for this answer for 10 days !!
Nobody knows ! :stuck_out_tongue_winking_eye:
Thank you very much Volodymyr

did u got this?

Yes , that works :stuck_out_tongue_winking_eye: