Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Tom Rettigs Library - makedate(<c date string> [,<n months>]) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 MAKEDATE(<C date string> [,<N months>])
 Makes an invalid date string valid and adds or subtracts months.
 Returns valid <expD> of <date string>, even if <date string> is invalid.

 <date string> is in the format "YYYYMMDD".
 <months> optionally to add or subtract.

 Returns an empty <expD> if <date string> is not in the proper format.

 Takes a "best guess" in cases where the valid date is not obvious.

 * Date string from calculations may be invalid
 m_datestr = STR(  YEAR(DATE())            ) +;
             STR( MONTH(DATE()) + m_months ) +;
             STR(   DAY(DATE()) + m_days   )

 * Date type is blank if date string is invalid
 date_type = STOD(m_datestr)

 * Date type is valid even if date string is invalid
 date_type = MAKEDATE(m_datestr)

 * Add 1.23 months to current date
 new_date = MAKEDATE( DTOS(DATE()), 1.23 )

 * Subtract 1.23 months from current date
 new_date = MAKEDATE( DTOS(DATE()), -1.23 )


             Placed in the Public Domain by Tom Rettig Assoc.

See Also: CDTOS() ISDSDATE() NTOD() STOD()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson