Get Date Using JavaScript

We can get Date using JavaScript built in object Date. In below example we will see how to get date using JavaScript Date object. example to get current date using JavaScript in dd-mm-yyyy format:- var today = new Date(); var day = today.getDate(); var month = today.getMonth()+1; //first month starts from 0 var year = … Read more

Get Current Date and Time in Java

In this post we will see that how to get current date and time in java using the class java.util.Date and java.text.SimpleDateFormat. Below is the code to get current date and time in java using Date class :- import java.text.SimpleDateFormat; import java.util.Date; public class CurrentDate { public static void main(String[] args) { Date dt = … Read more