Search found 4 matches

by DOSuser
01 Oct 2023 08:55
Forum: DOS Batch Forum
Topic: epoch time - solved
Replies: 3
Views: 13394

Re: epoch time - solved

A third version which only uses DOS batch commands - no vbscript and no power shell : epochbat ep timezone_offset_hours -- epoch seconds since 01/01/1970 : -- ep [out,opt] - epoch seconds : -- timezone_offset in hours (eastern us standard time is 4) @echo off SETLOCAL set /A tzoffset=4 & rem timezon...
by DOSuser
01 Oct 2023 07:27
Forum: DOS Batch Forum
Topic: Is there a way to subtract 2 days from this batch file?
Replies: 5
Views: 19821

Re: Is there a way to subtract 2 days from this batch file?

@echo cd \ D: cd "D:\Misc\Downloads" For /f "tokens=1-4 delims=/ " %%d in ("%date%") DO REN "flyer.pdf" "Store weekly ad %%g%%e%%f.pdf" %windir%\explorer.exe /n,/e,"D:\Misc\Downloads\" :END Every Sunday morning, my local grocery store releases their weekly sales ad onto their website. I would load ...
by DOSuser
29 Sep 2023 12:38
Forum: DOS Batch Forum
Topic: epoch time - solved
Replies: 3
Views: 13394

epoch time - solved

To get an environment variable set to the linux version of epoch time (seconds since 01/01/1970) create two files , the first is named toEpoch.vbs and contains set dateTime= CreateObject("WbemScripting.SWbemDateTime") dateTime.SetVarDate (now()) 'WScript.Echo DateDiff("s", "01/01/1970 00:00:00", Now...
by DOSuser
25 Sep 2023 18:39
Forum: DOS Batch Forum
Topic: Hundreds of seconds since midnight timer function
Replies: 0
Views: 34790

Hundreds of seconds since midnight timer function

The following DOS batch file will set an environment variable to the number of seconds since midnight use it to time actions or to check if a given amount of time has passed the julian date can be used for calculations that pass midnight rename as timesec.bat @echo off if %1.==. GOTO SHOW_HELP if %1...