Date, birthday, years and days

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • GAV
    Forum Member
    • Jan 2004
    • 50

    Date, birthday, years and days

    Hallo guys!
    I in confusion...
    I need to make daughters the program-gift...
    Date of a birth the Program Is known should to display:
    - quantity of days before birthday (with this problem I have consulted)
    - and how many years will be executed in this birthday... (with this problem I have stopped)
    Somebody can help me?
    Thanks!
  • Mina
    Forum Member
    • Oct 2005
    • 630

    #2
    Originally posted by GAV View Post
    Hallo guys!
    I in confusion...
    I need to make daughters the program-gift...
    Date of a birth the Program Is known should to display:
    - quantity of days before birthday (with this problem I have consulted)
    - and how many years will be executed in this birthday... (with this problem I have stopped)
    Somebody can help me?
    Thanks!
    Not sure what you're looking for.
    However, this might help


    If not, how about a Search

    Comment

    • GAV
      Forum Member
      • Jan 2004
      • 50

      #3
      Thanks Mina!
      I already use this plug-in
      Search has not helped me while...
      I shall try to explain:
      - Date of a birth - on July, 8th, 1998
      - Current date - on December, 12th, 2007
      - I calculate how many days before birthday (I use DateDiff.GetDifference)
      - How to me to calculate, how many years will be to the child in following birthday? ...In this case it is not enough 2007-1998...

      I think, that it is necessary to use comparison of dates in a julian format, but I can not think up algorithm yet

      Comment

      • Mina
        Forum Member
        • Oct 2005
        • 630

        #4
        As far as I understand,
        1- You need to find the number of days left for <x>'s birthday
        2- You need to find how old he or she will be

        Code:
        Birthday_Month = "6" --(July)--
        Birthday_Day = "8"
        Birthday_Year = "1998"
        
        Current_Month = System.GetDate(DATE_FMT_MONTH);
        Current_Day = System.GetDate(DATE_FMT_DAY);
        Current_Year = System.GetDate(DATE_FMT_YEAR);
        
        Birthday_Date = Birthday_Month.."/"..Birthday_Day.."/"..Birthday_Year
        Current_Date = Current_Month.."/"..Current_Day.."/"..Current_Year
        
        Days_Left = DateDiff.GetDifference(Current_Date, Birthday_Month.."/"..Birthday_Day.."/"..Current_Year);
        New_Age = (Current_Year - Birthday_Year)
        
        --Let's assume it's "Noora's" Birthday--
        Dialog.Message("Notice", "Noora will be "..New_Age.." years old in "..Days_Left.." Days!", MB_OK, MB_ICONNONE, MB_DEFBUTTON1);
        -----------------------------------------

        Comment

        Working...
        X