How to send url to Intent in Android

This code will open the link in your Android browser. We suppose you have an Activity and you did the correct imports :


String url = "";
Intent intent = new Intent(Intent.ACTION_VIEW);


The necessary imports are:

import android.content.Intent;
import android.os.Bundle;


How to convert Date into LocalDateTime in Java 8

The conversion between java.util.Data and LocaleDateTime is really simple in java 8,  check the following example.

Date to LocalDateTime

Date date = new Date();
Instant instant = date.toInstant();
LocalDateTime ldt = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());


LocalDateTime to Date

LocalDateTime ldt =;
ZonedDateTime zdt = ldt.atZone(ZoneId.systemDefault());
Date date = Date.from(zdt.toInstant());