iceberg-cpp
Loading...
Searching...
No Matches
timepoint.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
24
25#include <chrono>
26
28
29namespace iceberg {
30
33 std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds>;
34
37 std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>;
38
40ICEBERG_EXPORT TimePointMs TimePointMsFromUnixMs(int64_t unix_ms);
41
43ICEBERG_EXPORT int64_t UnixMsFromTimePointMs(TimePointMs time_point_ms);
44
46ICEBERG_EXPORT TimePointNs TimePointNsFromUnixNs(int64_t unix_ns);
47
49ICEBERG_EXPORT int64_t UnixNsFromTimePointNs(TimePointNs time_point_ns);
50
52ICEBERG_EXPORT std::string FormatTimePointMs(TimePointMs time_point_ms);
53
56
57} // namespace iceberg
Define symbol visibility macros for core Iceberg APIs.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:33
ICEBERG_EXPORT TimePointMs CurrentTimePointMs()
Returns a time point in milliseconds that represents the current system time.
ICEBERG_EXPORT TimePointNs TimePointNsFromUnixNs(int64_t unix_ns)
Returns a TimePointNs from a Unix timestamp in nanoseconds.
std::chrono::time_point< std::chrono::system_clock, std::chrono::milliseconds > TimePointMs
A time point in milliseconds.
Definition timepoint.h:33
ICEBERG_EXPORT int64_t UnixMsFromTimePointMs(TimePointMs time_point_ms)
Returns a Unix timestamp in milliseconds from a TimePointMs.
ICEBERG_EXPORT TimePointMs TimePointMsFromUnixMs(int64_t unix_ms)
Returns a TimePointMs from a Unix timestamp in milliseconds.
ICEBERG_EXPORT std::string FormatTimePointMs(TimePointMs time_point_ms)
Returns a human-readable string representation of a TimePointMs.
ICEBERG_EXPORT int64_t UnixNsFromTimePointNs(TimePointNs time_point_ns)
Returns a Unix timestamp in nanoseconds from a TimePointNs.
std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > TimePointNs
A time point in nanoseconds.
Definition timepoint.h:37