DateTools : Some tools to work with date and time

No issue for me.
image

So why it is comming issue in mine?? I have done everything as like you. The format is also correct then also.

Try in a new project.

What about providing a Do it result?
Taifun

Is there any way to convert date/time(past/future) to epoch time.

Can be done using Clock.

What about its format?

Month/Date/Year hour:minute:seconds

Hi, I am getting this error when I call getonlinedatetime on android 7 (Lenovo P2 stock rom).

The operation Duration cannot accept the arguments: , [“java.lang.NullPointerException: Attempt to invoke virtual method ‘int java.net.DatagramSocket.getSoTimeout()’ on a null object reference”], [1699597457636]

If I disable getonlinedatetime block, I am not getting the error.

net_URL: https://www.google.com/
I am just calling “check_network” procedure when screen1 initializes. (I have only one screen.)

blocks_

I have no error on Samsung s22’s android 13.
Min SDK Level of the project is android 5.0 (API21).
What can be the problem?

Show your blocks.

I added blocks to original post. thanks for your quick reply.

Test your app here and then posts the logs.

I tested on nexus 5 Android 7.1 which is more similar to lenovo p2. but it seems to work properly. Logs are here:
2023-11-11 14-38-12 debug log.txt (210.2 KB)

So issue might be device specific?
Make sure you are using latest version of extension.

I think, the problem may only occur with kodular companion on older android sdk’s.
But it is a old phone and it already has latest version which is android 7.0.
As I said before, online tester of kodular works properly on samsung s22 android 13
What could be causing the problem for that error? And can I take precautions against this error on blocks side?

I missed to write latest version of extension in my previous post.

However, I would need logs of your android 7 to check what’s going wrong.

How can I collect logs from my phone? Is there a tutorial for that?

Fortunately yes.

Logs are here:(only errors)
logcat_p2.txt (277.4 KB)
Thank you very much for your great interest.

edit: I am also adding full log:
logcat_p2_full.txt (779.7 KB)

Ok, I have found the issue.
Strange it appears only on few devices.