Loading...
Searching...
No Matches
utmscale.h
Go to the documentation of this file.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 2004 - 2008, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*/
#ifndef UTMSCALE_H
#define UTMSCALE_H
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
typedef enum UDateTimeScale {
UDTS_JAVA_TIME = 0,
UDTS_UNIX_TIME,
UDTS_ICU4C_TIME,
UDTS_WINDOWS_FILE_TIME,
UDTS_DOTNET_DATE_TIME,
UDTS_MAC_OLD_TIME,
UDTS_MAC_TIME,
UDTS_EXCEL_TIME,
UDTS_DB2_TIME,
UDTS_UNIX_MICROSECONDS_TIME,
#ifndef U_HIDE_DEPRECATED_API
UDTS_MAX_SCALE
#endif /* U_HIDE_DEPRECATED_API */
} UDateTimeScale;
typedef enum UTimeScaleValue {
UTSV_UNITS_VALUE = 0,
UTSV_EPOCH_OFFSET_VALUE=1,
UTSV_FROM_MIN_VALUE=2,
UTSV_FROM_MAX_VALUE=3,
UTSV_TO_MIN_VALUE=4,
UTSV_TO_MAX_VALUE=5,
#ifndef U_HIDE_INTERNAL_API
UTSV_EPOCH_OFFSET_PLUS_1_VALUE=6,
UTSV_EPOCH_OFFSET_MINUS_1_VALUE=7,
UTSV_UNITS_ROUND_VALUE=8,
UTSV_MIN_ROUND_VALUE=9,
UTSV_MAX_ROUND_VALUE=10,
#endif /* U_HIDE_INTERNAL_API */
#ifndef U_HIDE_DEPRECATED_API
UTSV_MAX_SCALE_VALUE=11
#endif /* U_HIDE_DEPRECATED_API */
} UTimeScaleValue;
U_CAPI int64_t U_EXPORT2
utmscale_getTimeScaleValue(UDateTimeScale timeScale, UTimeScaleValue value, UErrorCode *status);
/* Conversion to 'universal time scale' */
U_CAPI int64_t U_EXPORT2
utmscale_fromInt64(int64_t otherTime, UDateTimeScale timeScale, UErrorCode *status);
/* Conversion from 'universal time scale' */
U_CAPI int64_t U_EXPORT2
utmscale_toInt64(int64_t universalTime, UDateTimeScale timeScale, UErrorCode *status);
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition umachine.h:110
utmscale_fromInt64
U_CAPI int64_t utmscale_fromInt64(int64_t otherTime, UDateTimeScale timeScale, UErrorCode *status)
Convert a int64_t datetime from the given time scale to the universal time scale.
utmscale_getTimeScaleValue
U_CAPI int64_t utmscale_getTimeScaleValue(UDateTimeScale timeScale, UTimeScaleValue value, UErrorCode *status)
Get a value associated with a particular time scale.
utmscale_toInt64
U_CAPI int64_t utmscale_toInt64(int64_t universalTime, UDateTimeScale timeScale, UErrorCode *status)
Convert a datetime from the universal time scale to a int64_t in the given time scale.
UTimeScaleValue
UTimeScaleValue
UTimeScaleValue values are used to specify the time scale values to utmscale_getTimeScaleValue.
Definition utmscale.h:304
UTSV_EPOCH_OFFSET_MINUS_1_VALUE
@ UTSV_EPOCH_OFFSET_MINUS_1_VALUE
The constant used to select the epoch plus one value for a time scale.
Definition utmscale.h:390
UTSV_TO_MIN_VALUE
@ UTSV_TO_MIN_VALUE
The constant used to select the minimum to value for a time scale.
Definition utmscale.h:353
UTSV_UNITS_VALUE
@ UTSV_UNITS_VALUE
The constant used to select the units vale for a time scale.
Definition utmscale.h:313
UTSV_TO_MAX_VALUE
@ UTSV_TO_MAX_VALUE
The constant used to select the maximum to value for a time scale.
Definition utmscale.h:363
UTSV_MAX_ROUND_VALUE
@ UTSV_MAX_ROUND_VALUE
The constant used to select the maximum safe rounding value for a time scale.
Definition utmscale.h:426
UTSV_FROM_MIN_VALUE
@ UTSV_FROM_MIN_VALUE
The constant used to select the minimum from value for a time scale.
Definition utmscale.h:333
UTSV_MIN_ROUND_VALUE
@ UTSV_MIN_ROUND_VALUE
The constant used to select the minimum safe rounding value for a time scale.
Definition utmscale.h:414
UTSV_UNITS_ROUND_VALUE
@ UTSV_UNITS_ROUND_VALUE
The constant used to select the units round value for a time scale.
Definition utmscale.h:402
UTSV_EPOCH_OFFSET_PLUS_1_VALUE
@ UTSV_EPOCH_OFFSET_PLUS_1_VALUE
The constant used to select the epoch plus one value for a time scale.
Definition utmscale.h:377
UTSV_EPOCH_OFFSET_VALUE
@ UTSV_EPOCH_OFFSET_VALUE
The constant used to select the epoch offset value for a time scale.
Definition utmscale.h:323
UTSV_MAX_SCALE_VALUE
@ UTSV_MAX_SCALE_VALUE
The number of time scale values, in other words limit of this enum.
Definition utmscale.h:437
UTSV_FROM_MAX_VALUE
@ UTSV_FROM_MAX_VALUE
The constant used to select the maximum from value for a time scale.
Definition utmscale.h:343
UDateTimeScale
UDateTimeScale
UDateTimeScale values are used to specify the time scale used for conversion into or out if the unive...
Definition utmscale.h:204
UDTS_WINDOWS_FILE_TIME
@ UDTS_WINDOWS_FILE_TIME
Used in Windows for file times.
Definition utmscale.h:235
UDTS_MAC_OLD_TIME
@ UDTS_MAC_OLD_TIME
Used in older Macintosh systems.
Definition utmscale.h:251
UDTS_ICU4C_TIME
@ UDTS_ICU4C_TIME
Used in IUC4C.
Definition utmscale.h:227
UDTS_MAX_SCALE
@ UDTS_MAX_SCALE
The first unused time scale value.
Definition utmscale.h:291
UDTS_JAVA_TIME
@ UDTS_JAVA_TIME
Used in the JDK.
Definition utmscale.h:211
UDTS_DB2_TIME
@ UDTS_DB2_TIME
Used in DB2.
Definition utmscale.h:275
UDTS_EXCEL_TIME
@ UDTS_EXCEL_TIME
Used in Excel.
Definition utmscale.h:267
UDTS_MAC_TIME
@ UDTS_MAC_TIME
Used in newer Macintosh systems.
Definition utmscale.h:259
UDTS_UNIX_TIME
@ UDTS_UNIX_TIME
Used on Unix systems.
Definition utmscale.h:219
UDTS_UNIX_MICROSECONDS_TIME
@ UDTS_UNIX_MICROSECONDS_TIME
Data is a long.
Definition utmscale.h:284
UDTS_DOTNET_DATE_TIME
@ UDTS_DOTNET_DATE_TIME
Used in the .NET framework's System.DateTime structure.
Definition utmscale.h:243
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition utypes.h:509