Alpha DevCon 2018
Results 1 to 19 of 19

Thread: Getting US Standard date value?

  1. #1
    Member
    Real Name
    Gene FitzPatrick
    Join Date
    Mar 2011
    Posts
    204

    Default Getting US Standard date value?

    I am looking for an xbasic way to get the "real" current date value. That is to say, NOT THE SYSTEM DATE but the real date.

    I am trying to negate the possibility of the user changing the system date with the intent of back dating to negate an expiration date.

    Every command I have seen is influenced by the system settings. Anyone know of a date function that is not influenced by the system date settings?

    Thanks,

    Gene

  2. #2
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Getting US Standard date value?

    I am trying to negate the possibility of the user changing the system date with the intent of back dating to negate an expiration date.
    i am not an expert in these, but here is some food for thought.
    1) when the system is installed you could create a start_table with the installation date and total valid days. installation date will be obvious and total number of days is an integer number of days from the installation date.
    then create a script that calculates the expiration date like
    expiration_date = jtodate(jdate(installation_date) + total_valid_days)
    if expiration_date <> date() then
    msgbox("ALERT", "System date is wrong, software is deactivated, call me right away!")
    deactivate
    end if.
    2) this will require internet connection.
    create a simple a5w page in your computer or a licensing computer and the page only contains this code
    <%a5
    ?date()
    %>
    call it a5_date.a5w publish it to be available from outside and you can host it in your computer
    and then in the customer computer create a call to this page like
    dim cP as p
    cP = http_get(your_computer:port/directory/a5_date.a5w")
    dim current_date as d
    current_date = cP.body.
    that will give you the current date.
    then you can do action for licensing.

    these seems so convoluted way, as far as i know there is no way to beat the system clock. even going back to epoch depends on the system clock as far as i can tell.

    edit: on second thought, the first method also is dependent on system clock and not desirable for the question on hand.
    there was an article in learnalpha.com about licensing method by someone other than peter. if i find the link i will post it here later. may be that will help.
    Last edited by GGandhi; 04-08-2017 at 09:12 AM.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  3. #3
    Member
    Real Name
    Gene FitzPatrick
    Join Date
    Mar 2011
    Posts
    204

    Default Re: Getting US Standard date value?

    Thanks for trying Gandhi but as you noted, still relying on the system clock. There is a national time standard available but I do not know how to get that information into Alpha using xbasic. That's the challenge I am putting out there in "creative land"....

  4. #4
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Getting US Standard date value?

    you could use my second suggestion, if you like.
    just like calling any service, but your own service.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  5. #5
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,107

    Default Re: Getting US Standard date value?

    The attachment resets the system date/time via internet server. You might be able to modify it to just get the internet data/time.

    reset system time.txt
    There can be only one.

  6. #6
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,056

    Default Re: Getting US Standard date value?

    I also replied Gene, but my entry seems to have been deleted.
    The essence of the comment was that I would not worry too much, as changing the system date causes a whole lot of other issues with virus checkers, SSL's and reporting.
    Like Govindan, I sort of suggested a table to count the number of start up's of the application. You could also set a free monthly update procedure so each month a new licence key would be sent. Then you could see who wasn't renewing.
    As Stan pointed out ( at least I think he did ) be wary of changing system dates on someone else's machine. Capture the date only if possible.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  7. #7
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,652

    Default Re: Getting US Standard date value?

    INET::TimeCheck::NTPTime will give you the current date and time based on pool.ntp.org. There is also INET::TimeCheck::NISTTime which does the same thing using NIST servers, but their service is much less reliable so it sometimes errors out.

    Lenny Forziati
    Vice President, Internet Products and Technical Services
    Alpha Software Corporation

  8. #8
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,107

    Default Re: Getting US Standard date value?

    For the :: challenged, would you expand on how to implement INET::TimeCheck::NTPTime on the desktop?
    There can be only one.

  9. #9
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,056

    Default Re: Getting US Standard date value?

    Thanks for that Stan. I am one of the "challenged".
    I must presume that anyone changing the system date will also figure out that an I/net connection will probably need to be disabled, and if they did that, the application could be prevented from launching?
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  10. #10
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,652

    Default Re: Getting US Standard date value?

    From the Interactive Window:

    Code:
    ?INET::TimeCheck::NTPTime
    = 04/11/2017 12:37:50 84 pm
    But I just noticed this question is in the V11 area, and this is Alpha Anywhere functionality. I'm sorry for the confusion.

    Lenny Forziati
    Vice President, Internet Products and Technical Services
    Alpha Software Corporation

  11. #11
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,056

    Default Re: Getting US Standard date value?

    Well that dampened the fireworks, for sure!
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  12. #12
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,107

    Default Re: Getting US Standard date value?

    Thanks, Lenny.

    Still good to know for AA use and something to explore.
    There can be only one.

  13. #13
    Member
    Real Name
    Jack DeBoer
    Join Date
    Oct 2006
    Location
    Houston, TX
    Posts
    452

    Default Re: Getting US Standard date value?

    Quote Originally Posted by Lenny Forziati View Post
    From the Interactive Window:

    Code:
    ?INET::TimeCheck::NTPTime
    = 04/11/2017 12:37:50 84 pm
    But I just noticed this question is in the V11 area, and this is Alpha Anywhere functionality. I'm sorry for the confusion.

    I am using Alpha Anywhere V3.11 and I get "ERROR: Property not found" So it was added sometime after that.
    Last edited by turbojack; 04-11-2017 at 03:54 PM. Reason: Updated full version name

  14. #14
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,107

    Default Re: Getting US Standard date value?

    I believe Lenny pointed out............


    this is Alpha Anywhere functionality
    As in A5V12.
    There can be only one.

  15. #15
    Member Scott Kurimski's Avatar
    Real Name
    Scott Kurimski
    Join Date
    Jul 2009
    Posts
    327

    Default Re: Getting US Standard date value?

    Lenny, This is a really nice feature! Thanks.

    Is this an undocumented feature that will not be removed anytime soon? I cannot find it in the online help documentation.

    Thanks again,
    Scott

  16. #16
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,652

    Default Re: Getting US Standard date value?

    It is not intentionally undocumented, so we will get it added. There are no plans to remove it at all.

    Lenny Forziati
    Vice President, Internet Products and Technical Services
    Alpha Software Corporation

  17. #17
    Member
    Real Name
    Gene FitzPatrick
    Join Date
    Mar 2011
    Posts
    204

    Default Re: Getting US Standard date value?

    Hello to all!

    One of the things I like about this forum is the fact that I often learn alot about functionality when putting a general, mind provoking, post out there.

    I agree with the general consensus that changing a users' system clock is a no no. What I have accomplished is to check the users system date (simply using date()) and comparing that with the original install date (which I write to a hidden file) to find out if the user is trying to avoid licensing by back dating their system. If their current date() value is before their last stored license/install date, I provide a message to the user that my application will not run without a correct system date. I then close my application.

    This approach fits my needs. Lenny, I also thank you for ?INET::TimeCheck::NTPTime.

    Thanks to all.

    Gene

  18. #18
    Member
    Real Name
    Gene FitzPatrick
    Join Date
    Mar 2011
    Posts
    204

    Default Re: Getting US Standard date value?

    Lenny. I changed the date on my system to test the INET::TimeCheck::NTPTime function thinking that that function would return the correct date and time even if someone changed their own system clock. My assumption was incorrect. After changing the date to yesterday, INET::TimeCheck::NTPTime returned yesterdays date.

    Is there a function available that will show the correct current date and time and not just read the system clock?

    Thanks.

    Gene

  19. #19
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Getting US Standard date value?

    2) this will require internet connection.
    create a simple a5w page in your computer or a licensing computer and the page only contains this code
    <%a5
    ?date()
    %>
    call it a5_date.a5w publish it to be available from outside and you can host it in your computer
    and then in the customer computer create a call to this page like
    dim cP as p
    cP = http_get(your_computer:port/directory/a5_date.a5w")
    dim current_date as d
    current_date = cP.body.
    that will give you the current date.
    i posted this in the second post.
    you could easily do this unless somebody comes up with better one.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

Similar Threads

  1. jquery add ins - where do I put them? What is the new v11 standard?
    By MichaelCarroll in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 10-21-2011, 09:25 AM
  2. sql date time to standard format
    By Ken Tjia in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 09-25-2011, 01:24 AM
  3. 'Standard' form as MDI?
    By SwissCharles in forum Alpha Five Version 10 - Desktop Applications
    Replies: 9
    Last Post: 02-11-2011, 10:45 AM
  4. Standard Dialog Date Search
    By den1s in forum Application Server Version 9 - Web/Browser Applications
    Replies: 3
    Last Post: 02-27-2009, 01:19 PM
  5. platinum with standard
    By John Lemisch in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 07-28-2008, 03:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •