ICU 64.2  64.2
Data Structures | Namespaces | Typedefs | Enumerations
reldatefmt.h File Reference

C++ API: Formats relative dates such as "1 day ago" or "tomorrow". More...

#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/udisplaycontext.h"
#include "unicode/ureldatefmt.h"
#include "unicode/locid.h"
#include "unicode/formattedvalue.h"

Go to the source code of this file.

Data Structures

class  icu::FormattedRelativeDateTime
 An immutable class containing the result of a relative datetime formatting operation. More...
 
class  icu::RelativeDateTimeFormatter
 Formats simple relative dates. More...
 

Namespaces

 icu
 File coll.h.
 

Typedefs

typedef enum UDateRelativeUnit UDateRelativeUnit
 Represents the unit for formatting a relative date. More...
 
typedef enum UDateAbsoluteUnit UDateAbsoluteUnit
 Represents an absolute unit. More...
 
typedef enum UDateDirection UDateDirection
 Represents a direction for an absolute unit e.g "Next Tuesday" or "Last Tuesday". More...
 

Enumerations

enum  UDateRelativeUnit {
  UDAT_RELATIVE_SECONDS, UDAT_RELATIVE_MINUTES, UDAT_RELATIVE_HOURS, UDAT_RELATIVE_DAYS,
  UDAT_RELATIVE_WEEKS, UDAT_RELATIVE_MONTHS, UDAT_RELATIVE_YEARS, UDAT_RELATIVE_UNIT_COUNT
}
 Represents the unit for formatting a relative date. More...
 
enum  UDateAbsoluteUnit {
  UDAT_ABSOLUTE_SUNDAY, UDAT_ABSOLUTE_MONDAY, UDAT_ABSOLUTE_TUESDAY, UDAT_ABSOLUTE_WEDNESDAY,
  UDAT_ABSOLUTE_THURSDAY, UDAT_ABSOLUTE_FRIDAY, UDAT_ABSOLUTE_SATURDAY, UDAT_ABSOLUTE_DAY,
  UDAT_ABSOLUTE_WEEK, UDAT_ABSOLUTE_MONTH, UDAT_ABSOLUTE_YEAR, UDAT_ABSOLUTE_NOW,
  UDAT_ABSOLUTE_QUARTER, UDAT_ABSOLUTE_UNIT_COUNT = UDAT_ABSOLUTE_NOW + 2
}
 Represents an absolute unit. More...
 
enum  UDateDirection {
  UDAT_DIRECTION_LAST_2, UDAT_DIRECTION_LAST, UDAT_DIRECTION_THIS, UDAT_DIRECTION_NEXT,
  UDAT_DIRECTION_NEXT_2, UDAT_DIRECTION_PLAIN, UDAT_DIRECTION_COUNT
}
 Represents a direction for an absolute unit e.g "Next Tuesday" or "Last Tuesday". More...
 

Detailed Description

C++ API: Formats relative dates such as "1 day ago" or "tomorrow".

Definition in file reldatefmt.h.

Typedef Documentation

◆ UDateAbsoluteUnit

Represents an absolute unit.

Stable:
ICU 53

◆ UDateDirection

Represents a direction for an absolute unit e.g "Next Tuesday" or "Last Tuesday".

Stable:
ICU 53

◆ UDateRelativeUnit

Represents the unit for formatting a relative date.

e.g "in 5 days" or "in 3 months"

Stable:
ICU 53

Enumeration Type Documentation

◆ UDateAbsoluteUnit

Represents an absolute unit.

Stable:
ICU 53
Enumerator
UDAT_ABSOLUTE_SUNDAY 

Sunday.

Stable:
ICU 53
UDAT_ABSOLUTE_MONDAY 

Monday.

Stable:
ICU 53
UDAT_ABSOLUTE_TUESDAY 

Tuesday.

Stable:
ICU 53
UDAT_ABSOLUTE_WEDNESDAY 

Wednesday.

Stable:
ICU 53
UDAT_ABSOLUTE_THURSDAY 

Thursday.

Stable:
ICU 53
UDAT_ABSOLUTE_FRIDAY 

Friday.

Stable:
ICU 53
UDAT_ABSOLUTE_SATURDAY 

Saturday.

Stable:
ICU 53
UDAT_ABSOLUTE_DAY 

Day.

Stable:
ICU 53
UDAT_ABSOLUTE_WEEK 

Week.

Stable:
ICU 53
UDAT_ABSOLUTE_MONTH 

Month.

Stable:
ICU 53
UDAT_ABSOLUTE_YEAR 

Year.

Stable:
ICU 53
UDAT_ABSOLUTE_NOW 

Now.

Stable:
ICU 53
UDAT_ABSOLUTE_QUARTER 

Quarter.

Draft:
This API may be changed in the future versions and was introduced in ICU 63
UDAT_ABSOLUTE_UNIT_COUNT 

One more than the highest normal UDateAbsoluteUnit value.

Deprecated:
ICU 58 The numeric value may change over time, see ICU ticket #12420.

Definition at line 93 of file reldatefmt.h.

◆ UDateDirection

Represents a direction for an absolute unit e.g "Next Tuesday" or "Last Tuesday".

Stable:
ICU 53
Enumerator
UDAT_DIRECTION_LAST_2 

Two before.

Not fully supported in every locale.

Stable:
ICU 53
UDAT_DIRECTION_LAST 

Last.

Stable:
ICU 53
UDAT_DIRECTION_THIS 

This.

Stable:
ICU 53
UDAT_DIRECTION_NEXT 

Next.

Stable:
ICU 53
UDAT_DIRECTION_NEXT_2 

Two after.

Not fully supported in every locale.

Stable:
ICU 53
UDAT_DIRECTION_PLAIN 

Plain, which means the absence of a qualifier.

Stable:
ICU 53
UDAT_DIRECTION_COUNT 

One more than the highest normal UDateDirection value.

Deprecated:
ICU 58 The numeric value may change over time, see ICU ticket #12420.

Definition at line 191 of file reldatefmt.h.

◆ UDateRelativeUnit

Represents the unit for formatting a relative date.

e.g "in 5 days" or "in 3 months"

Stable:
ICU 53
Enumerator
UDAT_RELATIVE_SECONDS 

Seconds.

Stable:
ICU 53
UDAT_RELATIVE_MINUTES 

Minutes.

Stable:
ICU 53
UDAT_RELATIVE_HOURS 

Hours.

Stable:
ICU 53
UDAT_RELATIVE_DAYS 

Days.

Stable:
ICU 53
UDAT_RELATIVE_WEEKS 

Weeks.

Stable:
ICU 53
UDAT_RELATIVE_MONTHS 

Months.

Stable:
ICU 53
UDAT_RELATIVE_YEARS 

Years.

Stable:
ICU 53
UDAT_RELATIVE_UNIT_COUNT 

One more than the highest normal UDateRelativeUnit value.

Deprecated:
ICU 58 The numeric value may change over time, see ICU ticket #12420.

Definition at line 36 of file reldatefmt.h.