LibreOffice Module unotools (master) 1
datetime.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
21#ifndef INCLUDED_UNOTOOLS_DATETIME_HXX
22#define INCLUDED_UNOTOOLS_DATETIME_HXX
23
24//= conversions UNO3.TimeClass <-> Tools.TimeClass (Date/Time/DateTime)
26#include <rtl/ustring.hxx>
27
28namespace com::sun::star::util { struct Date; }
29namespace com::sun::star::util { struct DateTime; }
30namespace com::sun::star::util { struct Time; }
31
32class Date;
33class DateTime;
35
36namespace utl
37{
39 UNOTOOLS_DLLPUBLIC DateTime GetDateTime(const css::util::DateTime& _rDT);
40 UNOTOOLS_DLLPUBLIC OUString GetDateTimeString(const css::util::DateTime& _rDT);
41 UNOTOOLS_DLLPUBLIC OUString GetDateTimeString(sal_Int32 _nDate, sal_Int32 _nTime);
42 UNOTOOLS_DLLPUBLIC OUString GetDateString(const css::util::DateTime& _rDT);
43
44 UNOTOOLS_DLLPUBLIC void typeConvert(const Date& _rDate, css::util::Date& _rOut);
45 UNOTOOLS_DLLPUBLIC void typeConvert(const css::util::Date& _rDate, Date& _rOut);
46
47 UNOTOOLS_DLLPUBLIC void typeConvert(const DateTime& _rDateTime, css::util::DateTime& _rOut);
48 UNOTOOLS_DLLPUBLIC void typeConvert(const css::util::DateTime& _rDateTime, DateTime& _rOut);
49
50 UNOTOOLS_DLLPUBLIC OUString toISO8601(const css::util::DateTime& _rDateTime);
51 UNOTOOLS_DLLPUBLIC bool ISO8601parseDateTime(std::u16string_view i_rIn, css::util::DateTime& o_rDateTime);
52 UNOTOOLS_DLLPUBLIC bool ISO8601parseDate(std::u16string_view i_rIn, css::util::Date& o_rDate);
53 UNOTOOLS_DLLPUBLIC bool ISO8601parseTime(std::u16string_view i_rIn, css::util::Time& o_Time);
54
55} // namespace utl
56
57#endif // INCLUDED_UNOTOOLS_DATETIME_HXX
58
59/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class can be accessed without locking because we load all of the data in the constructor.
OUString toISO8601(const css::util::DateTime &rDateTime)
Definition: datetime.cxx:264
void typeConvert(const Date &_rDate, css::util::Date &_rOut)
Definition: datetime.cxx:234
bool ISO8601parseDate(std::u16string_view aDateStr, css::util::Date &rDate)
convert ISO8601 Date String to util::Date
Definition: datetime.cxx:341
DateTime GetDateTime(const css::util::DateTime &_rDT)
Definition: datetime.cxx:209
OUString GetDateTimeString(const css::util::DateTime &_rDT)
Definition: datetime.cxx:211
const LocaleDataWrapper & GetLocaleData()
Definition: datetime.cxx:203
OUString GetDateString(const css::util::DateTime &_rDT)
Definition: datetime.cxx:229
bool ISO8601parseDateTime(std::u16string_view rString, css::util::DateTime &rDateTime)
convert ISO8601 DateTime String to util::DateTime
Definition: datetime.cxx:305
bool ISO8601parseTime(std::u16string_view aTimeStr, css::util::Time &rTime)
convert ISO8601 Time String to util::Time
Definition: datetime.cxx:381
#define UNOTOOLS_DLLPUBLIC