Get Time in hhmm format

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
KWiz
Junior Coder
Posts: 30
Joined: Sat Oct 07, 2006 1:43 pm

Get Time in hhmm format

Post by KWiz » Wed Jan 09, 2008 6:14 pm

Perhaps you could expand upon your GetTime command. Perhaps you could add the GetTimeUF command, which stands for GetTime into a Usable Format. When you run this new command, it would return the current time to the variable in a 4-digit hhmm format.

For example, instead of returning 12:47:18 PM, the new command would return 1247.

Another example, instead of returning 9:47:28 AM, the new command would return 0947 (4-digits).

Another example, instead of returning 3:50:12 PM, the new command would return 1550.

This would be especially useful for me. I know how to accomplish these same results by writing the appropriate script, but I still think it would be very helpful to have this new command. Additionally, I suppose you could add another command, GetTimeUFS, to incorporate seconds into the time variable.

KWiz

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jan 09, 2008 6:23 pm

Please see the Year, Month, Day, Hour, Min and Sec functions which let you create the date/time in any format you so wish.

Hour>hh
Min>mm
Let>MyPreferredTimeFormat=%hh%%mm%

You also have the full VBScript date/time functions.

Also see:
http://www.mjtnet.com/blog/2006/01/23/u ... variables/
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

KWiz
Junior Coder
Posts: 30
Joined: Sat Oct 07, 2006 1:43 pm

Post by KWiz » Wed Jan 09, 2008 7:01 pm

Oops, sorry, I just came across your hour, min, sec commands. Are these new? I don't remember seeing them in Version 7. I just upgraded to Version 10.

Sorry for the confusion, and thanks for the new commands!
KWiz

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jan 09, 2008 7:05 pm

No they are not new - been there for years - since v5! Check:
http://www.mjtnet.com/mswhatsnew.htm

KWiz
Junior Coder
Posts: 30
Joined: Sat Oct 07, 2006 1:43 pm

Post by KWiz » Sat Jan 12, 2008 3:09 am

Oh well gee, I wish you had the ability to read my mind 2.3 years ago. :cry:

http://www.mjtnet.com/forum/viewtopic.p ... highlight=

Where is a good mindreader when you need one?? lol.

Kwiz

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts