how to do dos date and time commands 
Author Message
 how to do dos date and time commands

hi,

how come "exec date" or "exec time" don't do anything in windows NT?

Michael



Sat, 19 Sep 1998 03:00:00 GMT  
 how to do dos date and time commands
"exec date" will hang because the date command not only returns the
current date, but also asks if you want to set a new one.

use "echo." to supply the default response as follows:

          set date_variable [exec echo.|date]

I don't know about NT, but this works for me in Windows3.1



Sat, 19 Sep 1998 03:00:00 GMT  
 how to do dos date and time commands

Quote:
 (Michael) writes:

: how come "exec date" or "exec time" don't do anything in windows NT?

They hang because MSDOS waits for input of a new value.
Try:
exec date << ""
which works even under Unix.




Sun, 20 Sep 1998 03:00:00 GMT  
 how to do dos date and time commands

Quote:

> "exec date" will hang because the date command not only returns the
> current date, but also asks if you want to set a new one.

> use "echo." to supply the default response as follows:

>           set date_variable [exec echo.|date]

> I don't know about NT, but this works for me in Windows3.1

It might be a lot better to use the tcl clock command instead, then the
code is portable.

--
**********************************************************************
* Gerald W. Lester                       | Voice:  +1 (504)-889-2784 *
* Computerized Processes Unlimited, Inc. | FAX:    +1 (504)-889-2799 *

* Metairie, LA 70001                     | WWW: http://www.cpu.com   *
*                  "Consulting System Integrators"                   *
**********************************************************************



Sun, 20 Sep 1998 03:00:00 GMT  
 how to do dos date and time commands


Quote:
>"exec date" will hang because the date command not only returns the
>current date, but also asks if you want to set a new one.

Under Tcl 7.5, just use

    clock format [clock seconds]
--
-- Never use irony and sarcasm,
-- the poor little barely awake things
-- won't get it.



Sun, 20 Sep 1998 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. DOS compressed date/time into real date/time

2. Create Time / date or Modified Time / date of a txt file

3. convert labview date/time to excel date/time

4. showing time + date from dos interupt

5. Doing run-time checks at compile-time

6. Dos Date & time to clarion date & time

7. Clarion Date (Long) -> Access Date\Time

8. time to time with different dates...

9. TIME&DATE in HTML shows TIME

10. Unix time to calendar date/time?

11. Changing date format when doing MySQL query?

12. file time to dos time

 

 
Powered by phpBB® Forum Software