SearchingStar Posted December 22, 2020 Share Posted December 22, 2020 Hi, I need to calculate time difference between two time pickers (not datetime picker). To create time picker I have used input type as time . <input type="time" class="form-control" name="eq_pf" id="eq_pf" value=""> // from time <input type="time" class="form-control" name="eq_pt" id="eq_pt" value=""> // to time I have searched and tried many codes but getting NaN or undefined alert. PS: In database field is of type time Please do needful, the great Genius mind over here 🙂 to a pure newbie  🙃 Link to comment Share on other sites More sharing options...
shaili_shah Posted December 25, 2020 Share Posted December 25, 2020 Hi, Good Morning I have done the code in fiddle just check it out :Â https://jsfiddle.net/Lb0cy5ak/ In the Date() method we have assign the date and time from out input tag and it will display difference in time. Hope it helps. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now