Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20

PHP date input ideas - 'disagreement' between me and my dev.

  1. #16
    gangel is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    190
    PHP i can do access!! access is working fine, im trying to get him to replicate my program on PHP.

    I just noticed my body subject didnt say PHP only my title!


    Sorry :/

  2. #17
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,315
    I'm sorry but I did not understand. I don't know how to code in PHP but I do know VBA.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  3. #18
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,315
    I'm not sure I can help here. Does your Dev know PHP?
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  4. #19
    ssanfu is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    6,262
    PMFJI

    [Date field]
    input= 1/1
    date = 01/01/2016

    input= 1/1/15
    date = 01/01/2015
    Since your Access control is bound to a Date/Time type field, Access understands that any entry in the format of "MM/DD" or "M/D" should be a date. Since the year portion is missing, Access automatically adds/uses the current year.

    input= 12/12
    date DEFAULTS to 12/12/2015 as it is impossible for this task to have been done in the future and my program knows this.
    There is code somewhere that handle dates that are after the current date, that sets the year set to 2015 (the previous year).




    To have PHP do what Access does:
    Enter the date into a input box. Example 7/20
    Take the entry and parse it into month, day and year components. If no year in entry, set year to current year.
    If there is a year component, use the year from the date entry and automatically use format CCYY (CC = 20, YY = 16)

    If the month is greater than the current month and there was no year entered, set the year to the previous year.

    Replace the entry with the result.


    So, current date is Aug,2,2016

    Enter 7/20 in input box
    Parsed, it becomes Month = 7, day = 20, year = missing, so enter current year.
    Result = 7/20/2016


    Enter 7/20/15
    Parsed: Month = 7, day = 20 year = 2015
    Result = 7/20/2015


    Enter 10/6
    Parsed: Month = 10, Day = 6 Year = missing so use current year (2016)... but since current Month = 8, use the previous year
    Result = 10/6/2015


    Is this close?? I can somewhat read PHP, but I have not learned (yet) how to program in PHP..... yet another thing on the bucket list...
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

  5. #20
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,315
    Thanks for jumping in Steve.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Date input error
    By billybeer in forum Forms
    Replies: 4
    Last Post: 11-23-2015, 03:08 PM
  2. Auto Date input
    By skyi in forum Access
    Replies: 6
    Last Post: 09-19-2012, 12:58 AM
  3. Custom (?) Date Input Mask
    By SeaTigr in forum Access
    Replies: 3
    Last Post: 11-07-2011, 01:40 PM
  4. capturing the input date
    By rmohebian in forum Access
    Replies: 8
    Last Post: 02-10-2011, 01:54 PM
  5. date entry on input form
    By dzawicki in forum Forms
    Replies: 3
    Last Post: 12-25-2009, 07:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums