Log In   View a printable version of the current page.
Select Date Time (FP)
Added by Janice Wix, last edited by Janice Wix on Feb 24, 2007  (view change)
Labels: 
(None)


Select Date Time

Overview

Provides the means for specifying date/time values to attributes.
Date/time values may be defined for:

  • Date only
    • Date values may be specified using year, month, date attributes up to IFC 2x3.
    • Date values are extended to deal with historical and approximate dating from IFC 2x4.
  • Time only
    • Time values can be set in local time and can include offset from coordinated universal time (Greenwich Mean Time) and daylight saving offset.
  • Both date and time

Results

Specifies date and/or time.

Description Entity/Pset/Functional Part MAN REC OPT
Select whether date or time or date and time is to be used IfcDateTimeSelect    
If date is selected      

Set the year component

IfcCalendarDate.YearComponent::IfcYearNumber    

Set the month component


Values of month component are restricted to integer values between 1 and 12. A WHERE rule checks the validity on the month component.

IfcCalendarDate.MonthComponent::IfcMonthInYearYearNumber    

Set the day component


Values of day component are restricted to integer values according to the month and whether or not the year is a leap year. A function checks the validity of the day component.

IfcCalendarDate.DayComponent::IfcDayInMonthNumber    
If time is selected      

Set the hour component


Values of hour component are restricted to integer values between 0 and 23. A WHERE rule checks the validity of the hour component.

IfcLocalTime.HourComponent::IfcHourInDay    

Set the minute component


Values of minute component are restricted to integer values between 0 and 59. A WHERE rule checks the validity of the minute component.

IfcLocalTime.MinuteComponent::IfcMinuteInHour    

Set the second component


Values of second component are restricted to integer values between 0 and 59. A WHERE rule checks the validity of the second component.

IfcLocalTime.SecondComponent::IfcSecondInMinute    

Set the extent of the daylight saving offset

IfcLocalTime.DaylightSavingOffsetLLIfcDaylightSavingHour    

Set the time zone in which the local time occurs

IfcLocalTime.Zone::IfcCoordinatedUniversalTimeOffset    

Set the hour offset from coordinated universal time

IfcCoordinatedUniversalTimeOffset.HourOffset::IfcHourInDay    

Set the minute offset from coordinated universal time

IfcCoordinatedUniversalTimeOffset.MinuteOffset::IfcMinuteInHour    

Set the sense (ahead or behind) of the offset from coordinated universal time

IfcCoordinatedUniversalTimeOffset.Sense::IfcAheadOrBehind    
If date and time is selected        

Assert the date as elaborated in the date selection above

IfcDateAndTime.DateComponent::IfcCalendarDate    

Assert the time as elaborated in the time selection above

IfcDateAndTime.TimeComponent::IfcLocalTime    

IFC Entities Required

  • IfcCalendarDate
  • IfcLocalTime
  • IfcCoordinatedUniversalTimeOffset
  • IfcDateAndTime

IFC Datatypes Required

  • IfcDayInMonthNumber
  • IfcDaylightSavingHour
  • IfcHourInDay
  • IfcMinuteInHour
  • IfcMonthInYearNumber
  • IfcSecondInMinute
  • IfcYearNumber
  • IfcAheadOrBehind

IFC Functions Required

  • IfcLeapYear
  • IfcValidCalendarDate
  • IfcValidTime

IFC Property Sets Required

  • -

IDM Functional Parts Required

? -

EXPRESS-G

EXPRESS Schema

SCHEMA FP_SELECT_DATE_TIME;

  TYPE IfcDayInMonthNumber = INTEGER;
  END_TYPE;

  TYPE IfcDaylightSavingHour = INTEGER;
    WHERE
      WR1 : { 0 <= SELF <= 2 };
  END_TYPE;

  TYPE IfcHourInDay = INTEGER;
    WHERE
      WR1 : { 0 <= SELF < 24 };
  END_TYPE;

  TYPE IfcMinuteInHour = INTEGER;
    WHERE
      WR1 : {0 <= SELF <= 59 };
  END_TYPE;

  TYPE IfcMonthInYearNumber = INTEGER;
    WHERE
      WR1 : { 1<= SELF <= 12 };
  END_TYPE;

  TYPE IfcSecondInMinute = REAL;
    WHERE
      WR1 : { 0 <= SELF < 60 };
  END_TYPE;

  TYPE IfcYearNumber = INTEGER;
  END_TYPE;

  TYPE IfcAheadOrBehind = ENUMERATION OF
    (AHEAD,
     BEHIND);
  END_TYPE;

  ENTITY IfcCalendarDate;
      DayComponent   : IfcDayInMonthNumber;
      MonthComponent : IfcMonthInYearNumber;
      YearComponent  : IfcYearNumber;
    WHERE
      WR21 : IfcValidCalendarDate (SELF);
  END_ENTITY;

  ENTITY IfcLocalTime;
      HourComponent        : IfcHourInDay;
      MinuteComponent      : OPTIONAL IfcMinuteInHour;
      SecondComponent      : OPTIONAL IfcSecondInMinute;
      Zone                 : OPTIONAL IfcCoordinatedUniversalTimeOffset;
      DaylightSavingOffset : OPTIONAL IfcDaylightSavingHour;
    WHERE
      WR21 : IfcValidTime (SELF);
  END_ENTITY;

  ENTITY IfcCoordinatedUniversalTimeOffset;
      HourOffset   : IfcHourInDay;
      MinuteOffset : OPTIONAL IfcMinuteInHour;
      Sense        : IfcAheadOrBehind;
  END_ENTITY;

  ENTITY IfcDateAndTime;
      DateComponent : IfcCalendarDate;
      TimeComponent : IfcLocalTime;
  END_ENTITY;

  FUNCTION IfcValidCalendarDate
  (Date : IfcCalendarDate) : LOGICAL;
  IF NOT ({1 <= Date.DayComponent <= 31}) THEN    
    RETURN(FALSE);  
  END_IF;
  CASE Date.MonthComponent OF
    4         : RETURN({ 1<= Date.DayComponent <= 30});
    6         : RETURN({ 1<= Date.DayComponent <= 30});
    9         : RETURN({ 1<= Date.DayComponent <= 30});
    11        : RETURN({ 1<= Date.DayComponent <= 30});    
    2         :    
    BEGIN
      IF (IfcLeapYear(Date.YearComponent)) THEN
        RETURN({ 1<= Date.DayComponent <= 29});      
      ELSE
        RETURN({ 1<= Date.DayComponent <= 28});      
      END_IF;    
    END;
    OTHERWISE : RETURN(TRUE);  
  END_CASE;
  END_FUNCTION;

  FUNCTION IfcValidTime
  (Time: IfcLocalTime) : BOOLEAN;
  IF EXISTS (Time.SecondComponent) THEN
    RETURN (EXISTS (Time.MinuteComponent));  
  ELSE    
    RETURN (TRUE);  
  END_IF;
  END_FUNCTION;

  FUNCTION IfcLeapYear
  (Year : IfcYearNumber)
        :BOOLEAN;
  
  IF ((((Year MOD 4) = 0) AND ((Year MOD 100) <> 0)) OR
              ((Year MOD 400) = 0)) THEN
    RETURN(TRUE);
  ELSE
    RETURN(FALSE);
  END_IF;
  END_FUNCTION;

END_SCHEMA;

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.1.3 Build:#408 Jan 23, 2006) - Bug/feature request - Contact Administrators