| 1. |
Solve : Time converted in to seconds? |
|
Answer» Hi all, you can do your own maths in batch, If you prefer a batch solution, here's one... Code: [Select]@echo off set /a hh=%time:~0,2% set /a mm=%time:~3,2% set /a ss=%time:~6,2% set /a hh*=3600 set /a mm*=60 set /a hh+=mm set /a hh+=ss set /a timeseconds=%hh% echo time %time%, seconds since midnight = %timeseconds% Or, written more compactly, Code: [Select]@echo off set /a hh=%time:~0,2% & set /a mm=%time:~3,2% & set /a ss=%time:~6,2% set /a hh*=3600 & set /a mm*=60 & set /a hh+=mm & set /a hh+=ss set /a timeseconds=%hh% echo time %time%, seconds since midnight = %timeseconds% Thanks, both off you have been a great help |
|