JQuery Moment Get Current Date Example
Hi Bro,
Are you looking for example of jquery moment get current date. you can see jquery moment current date format. Here you will learn jquery moment js current date unix. you will learn jquery moment.js current date toISOString.
Here is a very simple example of how to get current date using jquery moment js. i will show you some moment method that getting current date.
Let's see simple example with output:
index.html
<!DOCTYPE html>
<html>
<head>
<title>JQuery Moment Get Current Date Example - ItSolutionStuff.com</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js" crossorigin="anonymous"></script>
</head>
<body>
<h1>JQuery Moment Get Current Date Example - ItSolutionStuff.com</h1>
</body>
<script type="text/javascript">
var currentDate1 = moment();
console.log('Current Date 1: ' + currentDate1);
var currentDate2 = moment().format();
console.log('Current Date 2: ' + currentDate2);
var currentDate3 = moment().format('MM/DD/YYYY');
console.log('Current Date 3: ' + currentDate3);
var currentDate4 = moment().unix();
console.log('Current Date 4: ' + currentDate4);
var currentDate5 = moment().toISOString();
console.log('Current Date 5: ' + currentDate5);
</script>
</html>
Output:
Current Date 1: 1608694675255
Current Date 2: 2020-12-23T09:07:55+05:30
Current Date 3: 12/23/2020
Current Date 4: 1608694675
Current Date 5: 2020-12-23T03:37:55.257Z
I hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- Laravel Carbon Get Last Day of Month Example
- How to Install and Use Moment JS in Laravel?
- How to Change Date Format in Codeigniter?
- How to Change Date Format using Moment in Vue JS?
- How to Change Date Format in JQuery?
- Laravel Carbon Get Year, Month and Day from Timestamp Example
- Laravel Where Clause with date_format() Example
- Bootstrap Timepicker using Datetimepicker JS Example
- Laravel Change Date Format using Carbon Example
- How to Find Day Name from Specific Date in PHP?