tag:blogger.com,1999:blog-20014007.post1774209507890762678..comments2023-10-12T12:48:25.133-06:00Comments on Lars Rasmussen - @nanoDBA: Writing a timestamp in Batch using WMICLars Rasmussenhttp://www.blogger.com/profile/02436107799416632673noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-20014007.post-29390116381740928012013-04-08T12:53:11.044-06:002013-04-08T12:53:11.044-06:00It would be better to do sorttime without the SET...It would be better to do sorttime without the SET /A math so as to avoid the discard of leading zeros, otherwise that code is like Cinderella's chariot and breaks down horribly at midnight.<br /><br />e.g. <br />IF %%B LSS 10 SET hr=0%%B<br />IF %%B GEQ 10 SET hr=%%B<br />... et cetera for minutes and seconds, then ...<br />SET sorttime=%hr%%min%%sec%<br /><br />It'll always look right that way, e.g. 00:01:30 will be sorttime 000130 and not 130.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-20014007.post-8867244775653057662011-03-11T08:53:56.053-07:002011-03-11T08:53:56.053-07:00Awesome Tip! I previously used realdate but it isn...Awesome Tip! I previously used realdate but it isn't supported for 64 bit.xparrothttps://www.blogger.com/profile/04600375744761716251noreply@blogger.com