Answer the question
In order to leave comments, you need to log in
How to turn 3w3d12h12m40s into normal time?
Hello.
I receive an uptime from the API in this form: 3w3d12h12m40s
How can I convert this time into a normal form?
Answer the question
In order to leave comments, you need to log in
Instead of
var current = this.slider.parent().parent().parent().find('.active').eq(this.currentImg);
current.removeClass('active');
var current = this.slider.parent().parent().parent().find('.active');
current.removeClass('active');
Not safe, but as an option without imports:
str1 = "3w3d12h12m40s"
seconds =
eval(
str1
.replace("w", "*86400*7+")
.replace("d", "*86400+")
.replace("h", "*3600+")
.replace("m", "*60+")
.replace("s", "")
)
# 2117560
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question