CLARION PROGRAMMING β DATETIME DATA TYPE MASTER QUIZ
Clarion DATETIME Data Type
20-Question Master Assessment & Detailed Answer Key
Overview: This master quiz tests core technical concepts regarding modern Clarion's scalar DATETIME data type, including its DECIMAL(19,7) internal representation, 100-nanosecond precision, epoch calculations, @C picture tokens, second-based arithmetic, DateTimeUtil helper class, and backend SQL driver mappings (MSSQL, PostgreSQL, Oracle, SQLite).
SECTION 1: QUIZ QUESTIONS
Q1. What is the primary purpose of the scalar DATETIME data type in modern Clarion?
A) To replace standard Clarion DATE and TIME fields in all local TopSpeed tables
B) To represent a unified date and time of day stored as a single scalar value, primarily mapping SQL timestamp columns
C) To convert Unix epoch timestamps into 32-bit integers
D) To store dates in string format for legacy Clipper compatibility
Q2. What is the underlying internal storage representation of a Clarion DATETIME variable?
A) A 4-byte signed LONG integer
B) An 8-byte composite GROUP over STRING(8)
C) A DECIMAL(19,7) (or PDECIMAL on Oracle)
D) A 64-bit IEEE 754 floating-point REAL
Q3. What is the maximum resolution/precision supported by the Clarion DATETIME data type?
A) 1 second
B) 1 millisecond
C) 1 microsecond
D) 100 nanoseconds
Q4. How does Clarion define the numeric epoch value zero for a DATETIME variable?
A) January 1, 1970 00:00:00
B) Midnight, December 28, 1800 (Clarion Standard Date zero)
C) January 1, 1900 00:00:00
D) January 1, 0001 00:00:00
Source-Grounded Clarion Reference Manuals Page 1
CLARION PROGRAMMING β DATETIME DATA TYPE MASTER QUIZ
Q5. What value represents a blank DATETIME in Clarion, and how is it handled when written to an SQL database?
A) Blank is represented by -1; it writes -1 to SQL
B) Blank is represented by 0; it writes NULL to SQL backends, and reading SQL NULL returns 0 C) Blank is represented by 86400; it writes 00:00:00 to SQL
D) Blank is represented by NULL; it throws a runtime error if assigned
Q6. Which picture token is used to format a DATETIME variable in ISO format (YYYY-MM-DD HH:MM:SS) showing whole seconds?
A) @D1
B) @T4
C) @C or @C0
D) @P#####P
Q7. What string length is required for a variable declared with the picture token STRING(@C7)?
A) 19 bytes
B) 21 bytes
C) 24 bytes
D) 27 bytes
Q8. An ENTRY control on a window uses the @C picture token for a DATETIME field. Which format will DEFORMAT() or the control accept?
A) Standard ISO string: '2026-09-09 13:05:07'
B) ISO string with 'T' separator: '2026-09-09T13:05:07.5'
C) Date-only string: '2026-09-09'
D) All of the above
Q9. How do addition and subtraction arithmetic operations operate directly on DATETIME values?
A) Operations add or subtract whole days (+1 adds 24 hours)
B) Operations operate directly in whole seconds (+3600 adds 1 hour; +86400 adds 1 day)
C) Operations add or subtract hundredths of a second
D) Operations require calling the CLOCK() procedure for each adjustment
Q10. What happens if you manually compute a DATETIME value using 'date * 86400' without specifying a decimal constant?
A) The expression evaluates correctly using 64-bit integer math
B) Integer overflow occurs because 32-bit LONG limits are exceeded for dates after January 1869
C) The compiler raises a syntax error
D) The time portion is automatically truncated to zero
Source-Grounded Clarion Reference Manuals Page 2
CLARION PROGRAMMING β DATETIME DATA TYPE MASTER QUIZ
Q11. What is the correct manual calculation formula to convert Clarion DATE and TIME fields into a DATETIME value?
A) dt = date * 86400 + time
B) dt = date * 86400.0 + CHOOSE(time = 0, 0, (time - 1) / 100)
C) dt = date + (time / 86400.0)
D) dt = (date + time) * 100.0
Q12. To use the DateTimeUtil helper class in a Clarion program module, which header file must be included?
A) CWUTIL.INC
B) DATETIME.INC
C) EQUATES.CLW
D) ABUTIL.INC
Q13. Which DateTimeUtil method captures the current system clock with 100-nanosecond precision?
A) DateTimeUtil.GetSystemTime()
B) DateTimeUtil.SetNow(dt)
C) DateTimeUtil.Clock()
D) DateTimeUtil.Today()
Q14. How does DateTimeUtil's Pict(dt, picture) method behave when formatting a DATETIME value?
A) It only accepts @C picture tokens
B) It allows formatting date or time parts using standard Clarion pictures like Pict(dt, '@D4') or Pict(dt, '@T4')
C) It converts the DATETIME into a CSTRING buffer
D) It converts the value into Unix epoch seconds
Q15. When a Clarion DATETIME value with fractional seconds is written to a Microsoft SQL Server smalldatetime column, what happens to fractional seconds?
A) They are rounded up to the nearest minute
B) They cause a driver error 47
C) They are truncated to fit the column's target scale
D) They are converted to a separate milliseconds column
Q16. Why do WATCH and PUT concurrency checks on legacy Microsoft SQL Server 'datetime' columns require extra caution with DATETIME fields?
A) Legacy MSSQL datetime columns store fractional seconds on a 1/300-second grid resolution, so optimistic concurrency checks only match exact grid fractions
B) Legacy datetime columns do not support NULL values
C) Legacy datetime columns throw a deadlock exception
D) Legacy datetime columns require 16-byte alignment
Source-Grounded Clarion Reference Manuals Page 3
CLARION PROGRAMMING β DATETIME DATA TYPE MASTER QUIZ
Q17. What target column type does the Clarion PostgreSQL / ODBC driver map to when a DATETIME field is created?
A) DATETIME
B) timestamp(6) (microsecond precision)
C) VARCHAR(27)
D) INT8
Q18. How does a Clarion VIEW process a filter expression containing a native DATETIME column when PROP:Filter is assigned?
A) The filter is evaluated locally line-by-line on the client PC
B) The driver translates the comparison into a native backend timestamp literal and evaluates it server-side
C) The filter is converted into a string comparison using @S27
D) Filters on DATETIME fields are not supported in VIEWs
Q19. How are parameter passing and reference variables restricted for DATETIME fields in Clarion procedure prototypes?
A) DATETIME fields can only be passed by value
B) DATETIME fields support &DATETIME; references and *DATETIME parameters, but passing by value is refused by the compiler
C) DATETIME fields must always be passed as LONG
D) DATETIME fields can only be passed inside a GROUP
Q20. What SQL import wizard setting controls whether database timestamp columns are imported as DATETIME or legacy GROUP overlays?
A) The 'Enable 64-bit Integer Support' checkbox
B) The 'Import date-time columns as DATETIME' checkbox (default OFF preserves 4-field GROUP shape)
C) The 'Use Legacy Drivers' checkbox
D) The 'Convert Dates to Strings' checkbox
Source-Grounded Clarion Reference Manuals Page 4