|
|
@@ -216,4 +216,18 @@ MACRO(ADD_SECONDS sec)
|
|
|
math(EXPR new_hr "${${GD_PREFIX}HOUR} + 1")
|
|
|
endwhile()
|
|
|
math(EXPR new_hr "${new_hr} % 24")
|
|
|
+
|
|
|
+ # Pad the H, M, S if needed
|
|
|
+ string(LENGTH ${new_sec} sec_len)
|
|
|
+ string(LENGTH ${new_min} min_len)
|
|
|
+ string(LENGTH ${new_hr} hr_len)
|
|
|
+ if(${sec_len} EQUAL 1)
|
|
|
+ set(new_sec "0${new_sec}")
|
|
|
+ endif()
|
|
|
+ if(${min_len} EQUAL 1)
|
|
|
+ set(new_min "0${new_min}")
|
|
|
+ endif()
|
|
|
+ if(${hr_len} EQUAL 1)
|
|
|
+ set(new_hr "0${new_hr}")
|
|
|
+ endif()
|
|
|
ENDMACRO(ADD_SECONDS)
|