I am working on a project (Android application using Apache Cordova HTML CSS JS).
I want to get the device current time and date.
I checked all the questions but none gives me a solution. Can someone help, please? Thanks.
Following code shows how to get datetime try this
var currentdate = new Date();
var datetime = currentdate.getDate() + "/"
+ (currentdate.getMonth()+1) + "/"
+ currentdate.getFullYear() + " @ "
+ currentdate.getHours() + ":"
+ currentdate.getMinutes() + ":"
+ currentdate.getSeconds();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With