Sign in to follow this  
Followers 0
Amen

Get DATE form Internet

5 posts in this topic

#1 ·  Posted (edited)

How can i Calculate if my prog Expired ? (My Prog must run only for one month).Is there any way to retrieve current date asking Internet and not a pc or a server on the LAN?

Edited by Amen

Share this post


Link to post
Share on other sites



What you could do is have your program write the current date to a file or a reg key. You could use the "_StringEncrypt" to encrypt the date ..?? B)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Share this post


Link to post
Share on other sites

ok Function Works fine! hope they give always the right date.he

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author:        Amen <BlackLily@freemail.gr>
;
; Script Function: Returns Global Date
; ----------------------------------------------------------------------------

Func _GlobalDate()
Local $Day[8],$Datefile,$_Date
$Datefile=@TempDir&"\Time.html"
$Day[1]="Monday"
$Day[2]="Tuesday"
$Day[3]="Wednesday"
$Day[4]="Thursday"
$Day[5]="Friday"
$Day[6]="Saturday"
$Day[7]="Sunday"

InetGet("http://nist.time.gov/timezone.cgi?Eastern/d/-5",$Datefile,1)
$_Date = FileRead($DAtefile, FileGetSize($DAtefile))
FileDelete($DAtefile)
For $i=1 to 7
    $msg=StringInStr($_Date,$Day[$i]);Holds potition of day found
    If $msg>0 then 
        $_Date=StringTrimLeft($_Date,$msg-1);Holds Day and after string
        $msg=StringInStr($_Date,"<");Holds the potition of first "<" found
        If $msg>0 then 
            $_Date=StringMid($_Date,1,$msg-1);Holds date.Format:    Friday,December 2,2005
            ExitLoop
        EndIf
    EndIf
NExt 
    return $_Date
EndFunc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0