python - How to change time format -


I have a python script that connects to DB and "% H:% M:% S \ n"

I need to change that time in seconds how can I do this?

p_out = p.stdout.read

) bar = [time.strptime (p_out, "% H:% M:% S \ n ")] m1 = time.maketime (bar [0] .timetplay ()) print m1 returns 0 main ()

If you need the total number only after the second, just insert the following code sample

  p_out = p.stdout. Read () times = [time.strptime (p_out, "% H:% M:% S \ n")] seconds S = (bar [0] .tm_hour * 60 * 60) + (bar [0] .tm_min * 60) + times [0] .tm_sec print second    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -