Login
Remember
Register
PHPOnlineSupport
Questions
Unanswered
Tags
Categories
Ask a Question
Ask a Question
Find difference between two dates
0
votes
984
views
asked
Jan 26, 2022
in
Jquery
by
Singer
How to find difference between two dates? Is there a lightweight library?
library
date
Your comment on this question:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
1
Answer
0
votes
answered
Jan 26, 2022
by
Sadu
Yes, you can use Jquery calendar, Moment.js, Day.js etc
I personanlly recommend the Day.js as its very lightweight
<script src="
https://unpkg.com/dayjs@1.8.21/dayjs.min.js"></script>
<script>dayjs().format()</script>
const date1 = dayjs('2019-01-25')
const date2 = dayjs('2019-01-26')
var diff = date1.diff(date2, 'day')
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
Related questions
0
votes
1
answer
1.1k
views
Day.js date difference not working
asked
Jan 26, 2022
in
Javascript
by
Sampath
date
difference
day
js
0
votes
1
answer
1.8k
views
Check where the current time is between a given time limit or not - PHP
asked
May 19, 2016
in
General
by
Mike
php
date
0
votes
1
answer
1.0k
views
How to format date and time in Day.js
asked
Jan 26, 2022
in
General
by
Jithu
day
js
date
time
format
0
votes
1
answer
875
views
Getting Current date, time , day in laravel
asked
Jun 3, 2021
in
Laravel
by
Nitha
laravel
date
0
votes
1
answer
861
views
What is the difference between public, private, and protected?
asked
Jun 4, 2021
in
General
by
Nimisha
php
function
0
votes
1
answer
807
views
Difference between get and post on php
asked
May 25, 2021
in
General
by
Tester jjavelin
(
120
points)
php
All categories
General
(56)
CMS
(21)
Frameworks
(21)
eCommerce
(58)
IOT - Internet Of Things
(10)
Javascript
(10)
Jquery
(7)
Databases
(5)
Categories
All categories
General
(56)
CMS
(21)
Frameworks
(21)
eCommerce
(58)
IOT - Internet Of Things
(10)
Javascript
(10)
Jquery
(7)
Databases
(5)
Most popular tags
magento
php
wordpress
wp
laravel
category
database
module
product
arduino
kohana
js
jquery
admin
date
url
sing
birds
json
javascript
cms
cache
error
configurable
love
mac
xbee
serial1
serial
seo
encrypt
recaptha
phalcon
truncate
fishpig
include
backend
function
email
plugin
post
arduinojson
popup
mongodb
security
migrate
editor
decrypt
python
iot
map
shipping
password
core
log
mage
pear
string
replace
extension
import
php7
form
order
day
google
image
youtube
https
http
customer
syntaxerror
datatables
nested
x-ctu
xctu
pan-id
mesh
coordinator
esp
baud
esp8266
esp32
path-issue
site-links
adblocker
qr-code
barcode
samsung
newsletter
feed
auto-numbering-column
datatable
admin-bar
adminbar
toolbar
address16
address64
301
302
...