Alpha Video Training
Results 1 to 11 of 11

Thread: A friendly word of warning about the date 01/01/2020

  1. #1
    Volunteer Moderator
    Real Name
    James A. Talbott, Jr.
    Join Date
    Apr 2000
    Location
    Lexington, KY
    Posts
    1,487

    Default A friendly word of warning about the date 01/01/2020

    We run a car club here, and have members renewing all the time. Since normal membership is for one year, we now have memberships expiring on 01/31/2020.
    If, however, you write 01/31/20, Alpha assumes this is 1920, not 2020.
    This is because in View | Settings | Date, there is a text box in the "Two digit dates between 00 and [ 20 ] are assumed to be int he 21st century."

    You can change the 20 to 50, or what ever suits you, to avoid this problem.

    Hope this helps someone.

    Jay
    Jay Talbott
    Lexington, KY


  2. #2
    "Certified" Alphaholic glenschild's Avatar
    Real Name
    Glen Schild
    Join Date
    Apr 2000
    Location
    Frome, Somerset, UK
    Posts
    1,530

    Default Re: A friendly word of warning about the date 01/01/2020

    Nice catch Jay!
    Glen Schild



    My Blog


  3. #3
    "Certified" Alphaholic Ronald Anusiewicz's Avatar
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,586

    Default Re: A friendly word of warning about the date 01/01/2020

    Is there a way to change this setting using xbasic? I have about 30 computers using the runtime that will need to be changed. Really don't want to have to sit down at each one to change this setting.
    Alpha Anywhere v3.5
    Version 12.3, Build 2999
    MySql56 & DBF's

    Alpha 4, 5, Anywhere

    Ron Anusiewicz

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

    Default Re: A friendly word of warning about the date 01/01/2020

    Quote Originally Posted by Ronald Anusiewicz View Post
    Is there a way to change this setting using xbasic? I have about 30 computers using the runtime that will need to be changed. Really don't want to have to sit down at each one to change this setting.
    I when and changed the setting in the database with my programming version. I just looked under the runtime and it is showing that it has been changed.

  5. #5
    Member
    Real Name
    Jon P Moody
    Join Date
    Nov 2016
    Posts
    196

    Default Re: A friendly word of warning about the date 01/01/2020

    Looks like this setting is in the registry and is stored at user level. Will see if I can find the key...

  6. #6
    Member
    Real Name
    Jon P Moody
    Join Date
    Nov 2016
    Posts
    196

    Default Re: A friendly word of warning about the date 01/01/2020

    For Alpha Anywhere it's in Computer\HKEY_CURRENT_USER\Software\Alpha Software\Alpha Anywhere 12.0\init\date\date_window#
    Similar path for V11 & V10

  7. #7
    "Certified" Alphaholic Ronald Anusiewicz's Avatar
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,586

    Default Re: A friendly word of warning about the date 01/01/2020

    I have a number of work stations connected to a network using the runtime application. I created this function which is to be
    called from the application's autoexec script. The function checks the existing date value and if it is different from the date
    value I want, the registry will be updated. I tested it with version 11 and AA and it appears to be working fine.

    In this example, I'm changing the date value from the default of 20 to 40. The registry value will be "40.000000"

    Code:
    FUNCTION Preferences AS C ( )
    	'sets the 21st century date
    	
    	vcYear = "40"	'enter the 2 digit year
    	vTarget = vcYear + ".000000"
    	
    	vVerNo = version("V")
    	if vVerNo = "12.0" then
    		vVer = "\Alpha Anywhere " + vVerNo
    	else
    		vVer = "\Alpha Five " + vVerNo
    	end if
    	
    	preferences = Registry.sys_get("HKEY_CURRENT_USER\Software\Alpha Software"+vVer+"\init\date\date_window#")
    	IF preferences <> vTarget THEN
    		registry.sys_create("HKEY_CURRENT_USER\Software\Alpha Software"+vVer+"\init\date\date_window#",vTarget)
    	END IF
    END FUNCTION
    Alpha Anywhere v3.5
    Version 12.3, Build 2999
    MySql56 & DBF's

    Alpha 4, 5, Anywhere

    Ron Anusiewicz

  8. #8
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,712

    Default Re: A friendly word of warning about the date 01/01/2020

    I suppose the only concern would be if not specifying 4 numbers for the year when entering a birthdate since 1940 is still in the valid range...
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  9. #9
    Member
    Real Name
    Marco Gallardo
    Join Date
    Sep 2016
    Posts
    36

    Default Re: A friendly word of warning about the date 01/01/2020

    I didn't realize this was a per/user setting, so when users started to mention the year was reverting to 1920 I was caught off guard this week. I addressed the issue by adding this snippet to the end of my Autoexec. Works in an old version of A5V12

    Code:
    dim currentSettings as P
    dim targetDateWindow as n = 30
    registry.load_settings("init",currentSettings)
    
    if .not. variable_exists("currentSettings.date.date_window") then
    	currentSettings.date.date_window = 0
    end if
    if currentSettings.date.date_window <> targetDateWindow then
    	dim updateSettings as p
    	updateSettings.date.date_window = targetDateWindow
    	registry.save_settings("init",updateSettings)
    end if
    The user will have to relaunch the database for the change to take effect. I couldn't figure out a way to force a refresh of the setting short of opening View>settings, which I was trying to avoid. So I force the users to relaunch the database (code not shown).

    Change "targetDateWindow" to whatever decade you want to cutoff to happen.

  10. #10
    Member
    Real Name
    Willie J. Goldwasser
    Join Date
    Dec 2005
    Posts
    9

    Default Re: A friendly word of warning about the date 01/01/2020

    Jay,
    Thanks very much for posting the solution.
    WJG

  11. #11
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,734

    Default Re: A friendly word of warning about the date 01/01/2020

    Thanks Ron. I have added a version of this to my autoexec.

    Bill.

Similar Threads

  1. Updating Booking calendar for 2019 & 2020
    By Paul Keane in forum Alpha Five Version 9 - Desktop Applications
    Replies: 7
    Last Post: 08-31-2018, 12:47 PM
  2. Friendly Dates problem with Detail View / Date Picker
    By kiwibruce in forum Mobile & Browser Applications
    Replies: 5
    Last Post: 08-06-2018, 05:07 PM
  3. SEO friendly url's & subfolders
    By Clipper87 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 16
    Last Post: 10-26-2011, 06:19 AM
  4. date field transfer to Word
    By Mike Wilson in forum Alpha Five Version 5
    Replies: 12
    Last Post: 04-05-2005, 11:29 AM
  5. HP1200 a word of warning
    By Bob Whitaker in forum Alpha Four Versions 7 and 8
    Replies: 0
    Last Post: 05-21-2002, 09:37 AM

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
  •