MySQL 9.6.0
Source Code Documentation
mysql_timestamp.h
Go to the documentation of this file.
1/* Copyright (c) 2025, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MYSQL_TIMESTAMP_H
25#define MYSQL_TIMESTAMP_H
26
27#include <my_inttypes.h>
30//! @cond Doxygen_Suppress
31#include <stdarg.h>
32//! @endcond
33
34/**
35 This service defines the timestamp function api.
36*/
38/**
39 Make and return an ISO 8601 / RFC 3339 compliant timestamp.
40
41 @param buffer a buffer of at least iso8601_size bytes to store
42 the timestamp in. The timestamp will be \0 terminated.
43 @param size size of the buffer.
44
45 @retval 0 if size < iso8601_size
46 else length of the timestamp (excluding \0)
47*/
48DECLARE_METHOD(int, make_iso8601_timestamp_now, (char *buffer, size_t size));
49
50/**
51 Make and return an ISO 8601 / RFC 3339 compliant timestamp.
52 Accepts the log_timestamps global variable in its third parameter.
53
54 @param buf A buffer of at least iso8601_size bytes to store
55 the timestamp in. The timestamp will be \0 terminated.
56 @param utime Microseconds since the epoch
57 @param mode if 0, use UTC; if 1, use local time
58
59 @retval length of timestamp (excluding \0)
60*/
61DECLARE_METHOD(int, make_iso8601_timestamp,
63
64END_SERVICE_DEFINITION(mysql_timestamp)
65
66#endif /* MYSQL_TIMESTAMP_H */
enum_iso8601_tzmode
Definition: iso8601_tzmode.h:35
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
size_t size(const char *const c)
Definition: base64.h:46
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
mode
Definition: file_handle.h:61
#define DECLARE_METHOD(retval, name, args)
Declares a method as a part of the Service definition.
Definition: service.h:103
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86