Page 1 of 1 1
Topic Options
#7798 - 2001-03-28 11:58 PM Changing Date & Time Format
Anonymous
Unregistered


I have a assignment asking me call the systems date and time and save it in a file in the following format.
"Mon 03/26/2001 18:10:58.75" . Does anyone have any ideas. I thought getting the information from the system would be easy, but I was mistaken. Your help is greatly appreciated.

Top
#7799 - 2001-03-29 01:16 AM Re: Changing Date & Time Format
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Try this:


substr(@day, 1, 3) " " @date " " @time ".00" ?


@day is "Thursday" so SUBSTR(@day, 1, 3) will show 3 chars starting at char 1 of @day

" " is a space

@date is the date

" " is another space

@time is the current time

and ".00" adds the milliseconds (bit of inaccuracy, but if you were counting the milliseconds, you wouldn't be using KiX


cj

------------------
For more scripts goto my website and click the hammer and spanner icon.

chrismat@ozemail.com.au

Top
#7800 - 2001-03-29 01:19 AM Re: Changing Date & Time Format
Anonymous
Unregistered


Thanks, but I think the milliseconds matters. Is there a way to harvest the information with shell and using windows command time /t?
Top
#7801 - 2001-03-29 02:06 AM Re: Changing Date & Time Format
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Here you go:

Milliseconds.KiX

code:

break on
cls


$=redirectoutput("cr", 1) ? $=redirectoutput("")


shell "%comspec% /c time <cr >time.txt"


$=open(1, "time.txt")
substr(@day, 1, 3) " " @date " " @time "." substr(readline(1), 31, 2) ?
$=close(1)



cj

Top
#7802 - 2001-03-29 02:10 AM Re: Changing Date & Time Format
Anonymous
Unregistered


Thanks a bunch!
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 823 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.051 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org