2 * Copyright 2010-2014, Haiku, Inc.
3 * Distributed under the terms of the MIT Licence.
5 #ifndef _B_DATE_TIME_FORMAT_H_
6 #define _B_DATE_TIME_FORMAT_H_
17 B_DATE_ELEMENT_INVALID
= 0,
18 B_DATE_ELEMENT_YEAR
= 1 << 0,
19 B_DATE_ELEMENT_MONTH
= 1 << 1,
20 B_DATE_ELEMENT_WEEKDAY
= 1 << 2,
21 B_DATE_ELEMENT_DAY
= 1 << 3,
22 B_DATE_ELEMENT_AM_PM
= 1 << 4,
23 B_DATE_ELEMENT_HOUR
= 1 << 5,
24 B_DATE_ELEMENT_MINUTE
= 1 << 6,
25 B_DATE_ELEMENT_SECOND
= 1 << 7,
26 B_DATE_ELEMENT_TIMEZONE
= 1 << 8
31 class BDateTimeFormat
: public BFormat
{
33 BDateTimeFormat(const BLocale
* locale
= NULL
);
34 BDateTimeFormat(const BLanguage
& language
,
35 const BFormattingConventions
& conventions
);
36 BDateTimeFormat(const BDateTimeFormat
&other
);
37 virtual ~BDateTimeFormat();
39 void SetDateTimeFormat(BDateFormatStyle dateStyle
,
40 BTimeFormatStyle timeStyle
,
45 ssize_t
Format(char* target
, const size_t maxSize
,
47 BDateFormatStyle dateStyle
,
48 BTimeFormatStyle timeStyle
) const;
49 status_t
Format(BString
& buffer
, const time_t time
,
50 BDateFormatStyle dateStyle
,
51 BTimeFormatStyle timeStyle
,
52 const BTimeZone
* timeZone
= NULL
) const;
55 U_ICU_NAMESPACE::DateFormat
* _CreateDateTimeFormatter(
56 const BString
& format
) const;
60 #endif // _B_DATE_TIME_FORMAT_H_