How to grab the date and time from the Web

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
PepsiHog
Automation Wizard
Posts: 513
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

How to grab the date and time from the Web

Post by PepsiHog » Sun Jun 20, 2010 7:14 pm

Hello,

Could someone show me how to use the FTP/HTTP commands to grab the date and time from the internet?

I want my program to be able to verify the date and time when it runs. But I don't want it to rely on the system clock.

I just want a variable for the date and time to be set, either combined or two variables, it doesn't matter.

Thanks a bunch,
PepsiHog
MS v11

Also, is there a way to confirm connection to the internet? I have DSL.
I can always make a work-around for this one, so not as important.
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Sun Jun 20, 2010 9:22 pm

Here is something simple

Code: Select all

Let>comma=,
HTTPRequest>http://json-time.appspot.com/time.json,,GET,,result
StringReplace>result,%LF%,,result
StringReplace>result,{,,result
StringReplace>result,},,result
Separate>result,comma,TimeVars
Let>myHour=TimeVars_2
Let>myDateTime=TimeVars_4
Let>mySeconds=TimeVars_5
Let>myMinutes=TimeVars_7
MessageModal>myHour
MessageModal>myDateTime
MessageModal>mySeconds
MessageModal>myMinutes


User avatar
PepsiHog
Automation Wizard
Posts: 513
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Here is something simple

Post by PepsiHog » Mon Jun 21, 2010 12:04 am

Thanks, adroege. That's just what I needed.

:D

PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

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