ICU 60.2 60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

utmscale.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 *******************************************************************************
5 * Copyright (C) 2004 - 2008, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 *******************************************************************************
8 */
9
10 #ifndef UTMSCALE_H
11 #define UTMSCALE_H
12
13 #include "unicode/utypes.h"
14
15 #if !UCONFIG_NO_FORMATTING
16
204 typedef enum UDateTimeScale {
211 UDTS_JAVA_TIME = 0,
212
219 UDTS_UNIX_TIME,
220
227 UDTS_ICU4C_TIME,
228
235 UDTS_WINDOWS_FILE_TIME,
236
243 UDTS_DOTNET_DATE_TIME,
244
251 UDTS_MAC_OLD_TIME,
252
259 UDTS_MAC_TIME,
260
267 UDTS_EXCEL_TIME,
268
275 UDTS_DB2_TIME,
276
284 UDTS_UNIX_MICROSECONDS_TIME,
285
286 #ifndef U_HIDE_DEPRECATED_API
287
291 UDTS_MAX_SCALE
292 #endif /* U_HIDE_DEPRECATED_API */
293
294 } UDateTimeScale;
295
304 typedef enum UTimeScaleValue {
313 UTSV_UNITS_VALUE = 0,
314
323 UTSV_EPOCH_OFFSET_VALUE=1,
324
333 UTSV_FROM_MIN_VALUE=2,
334
343 UTSV_FROM_MAX_VALUE=3,
344
353 UTSV_TO_MIN_VALUE=4,
354
363 UTSV_TO_MAX_VALUE=5,
364
365 #ifndef U_HIDE_INTERNAL_API
366
377 UTSV_EPOCH_OFFSET_PLUS_1_VALUE=6,
378
390 UTSV_EPOCH_OFFSET_MINUS_1_VALUE=7,
391
402 UTSV_UNITS_ROUND_VALUE=8,
403
414 UTSV_MIN_ROUND_VALUE=9,
415
426 UTSV_MAX_ROUND_VALUE=10,
427
428 #endif /* U_HIDE_INTERNAL_API */
429
430 #ifndef U_HIDE_DEPRECATED_API
431
437 UTSV_MAX_SCALE_VALUE=11
438 #endif /* U_HIDE_DEPRECATED_API */
439
440 } UTimeScaleValue;
441
452 U_STABLE int64_t U_EXPORT2
453 utmscale_getTimeScaleValue(UDateTimeScale timeScale, UTimeScaleValue value, UErrorCode *status);
454
455 /* Conversion to 'universal time scale' */
456
468 U_STABLE int64_t U_EXPORT2
469 utmscale_fromInt64(int64_t otherTime, UDateTimeScale timeScale, UErrorCode *status);
470
471 /* Conversion from 'universal time scale' */
472
484 U_STABLE int64_t U_EXPORT2
485 utmscale_toInt64(int64_t universalTime, UDateTimeScale timeScale, UErrorCode *status);
486
487 #endif /* #if !UCONFIG_NO_FORMATTING */
488
489 #endif
490
UTSV_MIN_ROUND_VALUE
The constant used to select the minimum safe rounding value for a time scale.
Definition: utmscale.h:414
UDTS_DOTNET_DATE_TIME
Used in the .NET framework&#39;s System.DateTime structure.
Definition: utmscale.h:243
UDTS_JAVA_TIME
Used in the JDK.
Definition: utmscale.h:211
UDTS_MAC_OLD_TIME
Used in older Macintosh systems.
Definition: utmscale.h:251
UDTS_ICU4C_TIME
Used in IUC4C.
Definition: utmscale.h:227
UDateTimeScale
UDateTimeScale
UDateTimeScale values are used to specify the time scale used for conversion into or out if the unive...
Definition: utmscale.h:204
utmscale_getTimeScaleValue
int64_t utmscale_getTimeScaleValue(UDateTimeScale timeScale, UTimeScaleValue value, UErrorCode *status)
Get a value associated with a particular time scale.
utmscale_toInt64
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.
UDTS_UNIX_MICROSECONDS_TIME
Data is a long.
Definition: utmscale.h:284
UDTS_EXCEL_TIME
Used in Excel.
Definition: utmscale.h:267
UTimeScaleValue
UTimeScaleValue
UTimeScaleValue values are used to specify the time scale values to utmscale_getTimeScaleValue.
Definition: utmscale.h:304
UDTS_MAC_TIME
Used in newer Macintosh systems.
Definition: utmscale.h:259
UDTS_UNIX_TIME
Used on Unix systems.
Definition: utmscale.h:219
UTSV_UNITS_ROUND_VALUE
The constant used to select the units round value for a time scale.
Definition: utmscale.h:402
UTSV_TO_MIN_VALUE
The constant used to select the minimum to value for a time scale.
Definition: utmscale.h:353
UDTS_MAX_SCALE
The first unused time scale value.
Definition: utmscale.h:291
UTSV_MAX_SCALE_VALUE
The number of time scale values, in other words limit of this enum.
Definition: utmscale.h:437
UTSV_FROM_MIN_VALUE
The constant used to select the minimum from value for a time scale.
Definition: utmscale.h:333
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_FROM_MAX_VALUE
The constant used to select the maximum from value for a time scale.
Definition: utmscale.h:343
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_MAX_VALUE
The constant used to select the maximum to value for a time scale.
Definition: utmscale.h:363
UTSV_EPOCH_OFFSET_VALUE
The constant used to select the epoch offset value for a time scale.
Definition: utmscale.h:323
utmscale_fromInt64
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. ...
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:396
UDTS_DB2_TIME
Used in DB2.
Definition: utmscale.h:275
UDTS_WINDOWS_FILE_TIME
Used in Windows for file times.
Definition: utmscale.h:235
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UTSV_UNITS_VALUE
The constant used to select the units vale for a time scale.
Definition: utmscale.h:313
UTSV_MAX_ROUND_VALUE
The constant used to select the maximum safe rounding value for a time scale.
Definition: utmscale.h:426
U_STABLE
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:111