how to parse a time in Ruby which takes a string in HH:MM and calculate seconds into the day -


this question has answer here:

i have method takes string in hh:mm format , should calculate how many seconds day is

time.strptime(mystring, "%h:%m") - time.now.beginning_of_day 

Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -