]> git.proxmox.com Git - libgit2.git/blame - src/util/date.h
Merge https://salsa.debian.org/debian/libgit2 into proxmox/bullseye
[libgit2.git] / src / util / date.h
CommitLineData
e579e0f7
MB
1/*
2 * Copyright (C) the libgit2 contributors. All rights reserved.
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
7#ifndef INCLUDE_date_h__
8#define INCLUDE_date_h__
9
10#include "util.h"
11#include "str.h"
12
13/*
14 * Parse a string into a value as a git_time_t.
15 *
16 * Sample valid input:
17 * - "yesterday"
18 * - "July 17, 2003"
19 * - "2003-7-17 08:23"
20 */
21extern int git_date_parse(git_time_t *out, const char *date);
22
23/*
24 * Format a git_time as a RFC2822 string
25 *
26 * @param out buffer to store formatted date
27 * @param time the time to be formatted
28 * @param offset the timezone offset
29 * @return 0 if successful; -1 on error
30 */
31extern int git_date_rfc2822_fmt(git_str *out, git_time_t time, int offset);
32
33#endif