Re: How old am I?

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 59922
interpreted = N
texte = This is what I use: WJ Starck wrote: > I want to express an age in years given the dob (mm/dd/yyyy) and > today's date. > > What's the [math] voodoo? [showif [date %m]>[birthDateMonth]] [math show=f]age=[date %Y]-[birthDateYear][/math] [/showif] [showif [date %m]<[birthDateMonth]] [math show=f]age=([date %Y]-[birthDateYear])-1[/math] [/showif] [showif [date %m]=[birthDateMonth]] [showif [date %d]=[birthDateDay]] [math show=f]age=[date %Y]-[birthDateYear][/math] [text show=f]birthdayMsg=Happy Birthday to Me![/text] [math show=f]BirthdayToday=1[/math] [/showif] [showif [date %d]>[birthDateDay]] [math show=f]age=[date %Y]-[birthDateYear][/math] [/showif] [showif [date %d]<[birthDateDay]] [math show=f]age=([date %Y]-[birthDateYear])-1[/math] [text]birthdayMsg=Wish me a Happy Birthday in [math][birthDateDay]-[date %d][/math] days![/text] [/showif] [/showif] I store the original birthday information in seperate fields for day, month and year. The above calculates the current age and also sets a flag if today is their birthday. The above was written and is used on 4.51 - works on 6.0 as well. > Thnx, > > Will ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: How old am I? ( Donovan Brooke 2004)
  2. Re: How old am I? ( "Chris List Recipient" 2004)
  3. Re: How old am I? ( Gary Krockover 2004)
  4. Re: How old am I? ( WJ Starck 2004)
  5. Re: How old am I? ( Gary Krockover 2004)
  6. Re: How old am I? ( WJ Starck 2004)
  7. Re: How old am I? ( eLists 2004)
  8. How old am I? ( WJ Starck 2004)
This is what I use: WJ Starck wrote: > I want to express an age in years given the dob (mm/dd/yyyy) and > today's date. > > What's the [math] voodoo? [showif [date %m]>[birthDateMonth]] [math show=f]age=[date %Y]-[birthDateYear][/math] [/showif] [showif [date %m]<[birthDateMonth]] [math show=f]age=([date %Y]-[birthDateYear])-1[/math] [/showif] [showif [date %m]=[birthDateMonth]] [showif [date %d]=[birthDateDay]] [math show=f]age=[date %Y]-[birthDateYear][/math] [text show=f]birthdayMsg=Happy Birthday to Me![/text] [math show=f]BirthdayToday=1[/math] [/showif] [showif [date %d]>[birthDateDay]] [math show=f]age=[date %Y]-[birthDateYear][/math] [/showif] [showif [date %d]<[birthDateDay]] [math show=f]age=([date %Y]-[birthDateYear])-1[/math] [text]birthdayMsg=Wish me a Happy Birthday in [math][birthDateDay]-[date %d][/math] days![/text] [/showif] [/showif] I store the original birthday information in seperate fields for day, month and year. The above calculates the current age and also sets a flag if today is their birthday. The above was written and is used on 4.51 - works on 6.0 as well. > Thnx, > > Will ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ eLists

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Problems with [Applescript] (1997) emailer (1997) WCf2 and nested tags (1997) SERIAL NUMBER PROBLEM *AGAIN*!!! (1998) Separate SSL Server (1997) [searchString] (1997) OK, here goes... (1997) WebCat B13 Mac CGI -- Frames question (1997) Bug or syntax error on my part? (1997) WebCat2b13MacPlugIn - [include] (1997) Week # problem (1998) More on the email templates (1997) Price override (2004) How can I Add several Items into the cart at once? (1997) [SearchString] problem with [search] context (1997) [WebDNA] Dreamweaver Tag Libraries and Snippets (2011) Re:How to Display text in empty fields (1997) How do I handle extra spaces? (2002) Clearing orders and database help! (1997) .. more on sliding discounts... (1997)