Shoutbox

Help: How to write time to a txt file? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Help: How to write time to a txt file? (/showthread.php?tid=76228)

Help: How to write time to a txt file? by alejoar on 07-21-2007 at 06:29 AM

How do I write the current system time (hours, minutes and seconds) to a txt file I already created?

The only thing I found was this:
http://www.mpscripts.net/code.php?id=29

I think it has something to do, but I couldn't make anything :S

Sory if this is a very stupid question.. Im a newbie xD

Thanks!!

EDIT: Just to make things easier, I already now how to add a line to a file, I just want to know how to set a variable containing the current time.


RE: Help: How to write time to a txt file? by CookieRevised on 07-21-2007 at 08:49 AM

The question is what do you want to do with that saved time?
What is the purpose of it?
And what exactly do you mean by "time"?
And in what format? hh:mm:ss? or including the date? Long date? Short date?
etc...

It depends on the answers of those questions...

eg: If it is just for logging purposes you can simple add a line to the file like "Saterday, Juli 21st, 2007, 10:40pm".

But, if you're going to read the file again later on, it is very vital that you save the date/time in a format you can easly work with (preferable numerical) and which is not variable like the one above. Like "2007-07-21 22:40:43".

Since you know how to write something to a file, all you need to know are the functions and methods regarding time and dates.
These can be found in the JScript 5.6 Documentation:
Contents > JScript (Windows Script Technologies) > JScript Language Reference > JScript Objects (JScript 5.6) > Date Object (Jscript 5.6)

If you go there you'll see all the methods and properties you can use regarding dates and times, including examples.


PS:

quote:
Originally posted by alejoar
The only thing I found was this:
http://www.mpscripts.net/code.php?id=29
That's for something completely different.
RE: Help: How to write time to a txt file? by GNSPS on 07-21-2007 at 01:14 PM

I'd like to have that jscript documentation but in those microsoft downloads it says my windows is not genuine... and no... I'm not responsible for that I haven't installed this windows... So, what can I do? Can't anyone of you, very nice people, send that file? :P If you can't or don't want to bother I'll understand but please make some suggestions.. XD


RE: Help: How to write time to a txt file? by alejoar on 07-21-2007 at 11:16 PM

Thanks!!!!

GNSPS, send me a pm with your email and Ill send it to you.


RE: Help: How to write time to a txt file? by scott2010_h on 07-22-2007 at 08:21 AM

or you could goto http://www.msgpluslive.net/scripts/browse/9/Tools...Script-Developers/
and get Windows Script Documentation 5.6


RE: Help: How to write time to a txt file? by Felu on 07-22-2007 at 08:47 AM

quote:
Originally posted by scott2010_h
or you could goto http://www.msgpluslive.net/scripts/browse/9/Tools...Script-Developers/
and get Windows Script Documentation 5.6
erm the download link redirects to Microsoft's Download Center which requires you to have a Genuine version of windows.