Admin Production ni-theme
Current Publication

CVIAbsoluteTimeToLocalCalendar

LabWindows/CVI

CVIAbsoluteTimeToLocalCalendar

int CVIAbsoluteTimeToLocalCalendar (CVIAbsoluteTime absoluteTime, unsigned int *year, unsigned int *month, unsigned int *day, unsigned int *hour, unsigned int *minute, unsigned int *second, double *millisecond, unsigned int *weekDay);

Purpose

Converts an absolute time value to local calendar time components using the current time zone setting for your system. You can pass NULL for one or more of the component output parameters that you do not need.

This function cannot convert the following Coordinated Universal Time (UTC) time values:

  • Time values before the year 1970 on Linux or in applications running on an RT target
  • Time values before the year 1601 on Windows operating systems.

(RT) You can set time zone settings for RT systems in MAX.

Parameters

Input
Name Type Description
absoluteTime CVIAbsoluteTime Absolute time value in National Instruments Binary Time Format.
Output
Name Type Description
year unsigned int The year in local calendar time.
month unsigned int The month in local calendar time.
day unsigned int The date of the month in local calendar time.
hour unsigned int The hour in local calendar time.
minute unsigned int The minute in local calendar time.
second unsigned int The second in local calendar time.
millisecond double The millisecond in local calendar time.
weekDay unsigned int The day of the week.

Return Value

Name Type Description
status int The result of the function call. Negative values represent errors.

The following table describes the results that this function returns.

Code Constant Description
0 or positive values Success.
–1 kCVITimeInvalidArgumentError An argument passed to the function is invalid.
–2 kCVITimeNullPointerError A NULL pointer was passed to the function instead of a valid memory address.
–3 kCVITimeOverflowError A numerical calculation resulted in an overflow.
–4 kCVITimeDateOutOfRangeError A time value passed to the function is not in the supported range.
–5 kCVITimeOperationFailedError The operation failed due to an unspecified system error.

Additional Information

Library: Utility Library

Include file: utility.h

LabWindows/CVI compatibility: LabWindows/CVI 9.0 and later

Example

Refer to utility\clock.cws for an example of using the CVIAbsoluteTimeToLocalCalendar function.