Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

Bloc de code
/* ___ Declarations _____________________________________________________________________
date        myDate1
date        myDate2
time_t      myTime1
time_t      myTime2
timestamp   myTimestamp1
timestamp   myTimestamp2
num_e(9,0)  myInterval1
num_e(9,0)  myInterval2
num_e(15,0) myInterval3

/* ___ Code _____________________________________________________________________________
myInterval1 = &date_interval(myDate1;myDate2)                /* number of days between myDate1 and myDate2 (can be a negative number if myDate1 if greater than myDate2)
myInterval2 = &time_interval(myTime1;myTime2)                /* number of seconds between myTime1 and myTime2 (can be a negative number if myTime1 if greater than myTime2)

myInterval3 = &tms_interval(myTimestamp1;myTimestamp2;'Y ')   /* number of years between myTimestamp1 and myTimestamp2 (can be a negative number if myTimestamp1 if greater than myTimestamp2)
myInterval3 = &tms_interval(myTimestamp1;myTimestamp2;'M ')   /* number of months between myTimestamp1 and myTimestamp2 (can be a negative number if myTimestamp1 if greater than myTimestamp2)
myInterval3 = &tms_interval(myTimestamp1;myTimestamp2;'D ')   /* number of days between myTimestamp1 and myTimestamp2 (can be a negative number if myTimestamp1 if greater than myTimestamp2)
myInterval3 = &tms_interval(myTimestamp1;myTimestamp2;'H ')   /* number of hours between myTimestamp1 and myTimestamp2 (can be a negative number if myTimestamp1 if greater than myTimestamp2)
myInterval3 = &tms_interval(myTimestamp1;myTimestamp2;'MI')   /* number of minutes between myTimestamp1 and myTimestamp2 (can be a negative number if myTimestamp1 if greater than myTimestamp2)
myInterval3 = &tms_interval(myTimestamp1;myTimestamp2;'S ')   /* number of seconds between myTimestamp1 and myTimestamp2 (can be a negative number if myTimestamp1 if greater than myTimestamp2)
myInterval3 = &tms_interval(myTimestamp1;myTimestamp2;'MS')   /* number of microseconds between myTimestamp1 and myTimestamp2 (can be a negative number if myTimestamp1 if greater than myTimestamp2)

3 - Extract informations from a Date variable

In order to extract informations from a Date variable, we can use the following functions

  • &Date_To_Year
  • &Date_To_Month
  • &Date_To_Day
  • &Date_To_Num


Bloc de code
/* ___ Déclarations _____________________________________________________________________
date        myDate
num_e(4,0)  myYear
num_e(2,0)  myMonth
num_e(2,0)  myDay

/* ___ Code _____________________________________________________________________________
myYear      = &date_to_year(myDate)                            /* extract the year from the date myDate (year will be in format CCYY (century + year)  
myMonth     = &date_to_month(myDate)                           /* extract the month from the date myDate
myDay       = &date_to_day(myDate)                             /*  extract the day from the date myDate


...

Image

1 - Transforming an alpha variable to an image variable

...