FICO
FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browserPrevious exampleNext example

Definition of type 'date' and subroutines for accessing it

Description
Language extensions provided by this module:
  • constants: boolean
  • type: system
  • subroutines: procedures and functions
  • operators: constructor, assignment, comparators
  • services: reset, accessing and enumerating parameters
  • parameter: boolean


Source Files
By clicking on a file name, a preview is opened at the bottom of this page.
date.c[download]

Data Files





date_test.mos

(!******************************************************
   Mosel NI Examples
   =================

   File date_test.mos
   ``````````````````
   Using module date

   (c) 2008 Fair Isaac Corporation
       author: Y. Colombani, 2002
*******************************************************!)

model "Test date module"

 uses "date"

 declarations
  today,d:date 
 end-declarations

!setparam("date_style",DATE_US)     ! Uncomment to use the US date style

! Initialize dates
 today:=getdatenow
 d:=date("1/1/2000")                ! Or: "1/1/2000 00:00:00"
 writeln("today is: ",today)
 writeln("d is    : ",d)

! Comparison of dates
 if d=today then
  writeln("d and today are the same")
 elif d<today then
  writeln("d is before today")
 else
  writeln("d is after today")
 end-if

! Access some detailed info
 writeln("The current year is ",today.year)

end-model

Back to examples browserPrevious exampleNext example