Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - day() return the day of the month http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 day()               Return the day of the month
------------------------------------------------------------------------------
 Declaration
   date.hdr

 Syntax
   func int day extern
   param value date dDate

 Arguments
   dDate is a date value to convert.

 Return
   A numeric integer in the range of zero to 31.

 Description
   The day() function returns the day of the month as represented by
   dDate.

 Example
   #define EXAMPLE_DATE
   #include example.hdr

   func char WhoWaters
   /*
   In cities where there are water shortages, allocation is done by the
   day. I.e., on ODD days, the residents of the north side of a city may
   water their lawns and on EVEN days the south side may water. This
   function returns which group may water.
   */
   if day( today() ) % 2 == 0  // if even day
      return( "South" )
   endif
   return( "North" )
   endproc
   
   proc Test_day
   // Automatically back up databases on the 1st and 15th of the month.
   if day(today()) == 1 .OR. day(today()) == 15
      ? "Must backup data"    // execute BackupData() function
   else
      ? "No backup today"
   endif
   ? WhoWaters()
   endproc

   proc main
   Test_day()
   endproc

See Also: month() year()

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