Jump to content

Recommended Posts

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
Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...