Computing.Net > Forums > Disk Operating System > Getting seconds from DOS

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Getting seconds from DOS

Reply to Message Icon

Name: jo_aze
Date: February 12, 2002 at 05:21:53 Pacific
Comment:

Hi,
Does someone know how to get seconds from DOS?
I'm running on NT 4.0 and using "Time /T"" command gives me the syntax: hh:mm in english format. Therefor i try with "time" command which gives me the exact syntax (ie. french format HH:MM:SS) but it seems not easy to extract what i need ...
Thanks for your help.



Sponsored Link
Ads by Google

Response Number 1
Name: ...
Date: February 12, 2002 at 05:28:06 Pacific
Reply:

HH:MM:SS is also the 'BRITISH' format.

Why not just use the TIME command?


0

Response Number 2
Name: Adam
Date: February 12, 2002 at 22:34:49 Pacific
Reply:

..., he's probably trying to do something with a batch file.


0

Response Number 3
Name: jo_aze
Date: February 13, 2002 at 00:43:38 Pacific
Reply:

That's exact.
I'd like to get this value into a batch file which create specific files with timestamp like: $FILE_HHMMSS.


0

Response Number 4
Name: ...
Date: February 13, 2002 at 02:42:11 Pacific
Reply:

AND seconds is THAT Important?


0

Response Number 5
Name: jo_aze
Date: February 13, 2002 at 08:12:55 Pacific
Reply:

Each file must be created with an extension different.
In fact, i try to develop a procedure which should be used throught a telnet session on NT server by different users. This procedure or batch file use user input written in qbasic and each call of these user input is done while launching:
qbasic /run $FILE_HHMM...


0

Related Posts

See More



Response Number 6
Name: Secret_Doom
Date: February 16, 2002 at 21:40:54 Pacific
Reply:

The following script was written on Win98, and will get the seconds decimals (00-99) to the %RANDOM% variable. I don't know if it works on NT:

@echo off
echo @PROMPT SET RANDOM=$T$_> %temp%.\$$tmp.bat
%comspec% /c %temp%.\$$tmp.bat > %temp%.\$$tmp2.bat
rem > %temp%.\$$tmp.bat
for %%s in (e10D'0' e10F''3B e112''3B e115''3B w q) do echo %%s>> %temp%.\$$tmp.bat
debug.exe %temp%.\$$tmp2.bat < %temp%.\$$tmp.bat > nul
call %temp%.\$$tmp2.bat
echo SET RANDOM=%%4> %temp%.\$$tmp.bat
::echo SET RANDOM=%%3> %temp%.\$$tmp.bat
call %temp%.\$$tmp.bat;%random%
for %%d in (tmp.bat tmp2.bat) do if exist %temp%.\$$%%d del %temp%.\$$%%d

WATCH OUT FOR LINE WRAPPING! Cut-paste this into a text file and it will be alright.

If you really want the SECONDS, not the decimals, uncomment the commented line (get out the "::" on its begin)

I hope it works on NT.

-- Secret_Doom - Leonardo Pignataro --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Getting seconds from DOS

how can i get var. in dos batch www.computing.net/answers/dos/how-can-i-get-var-in-dos-batch/12787.html

I can get you MS-DOS 6.22 www.computing.net/answers/dos/i-can-get-you-msdos-622/249.html

Can't Access the C Drive from DOS www.computing.net/answers/dos/cant-access-the-c-drive-from-dos/11315.html