1//========================================================================
2//
3// DateInfo.h
4//
5// Copyright (C) 2008, 2018, 2019 Albert Astals Cid <aacid@kde.org>
6// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org>
7// Copyright (C) 2015 André Guerreiro <aguerreiro1985@gmail.com>
8// Copyright (C) 2015 André Esser <bepandre@hotmail.com>
9// Copyright (C) 2016, 2021 Adrian Johnson <ajohnson@redneon.com>
10// Copyright (C) 2024 Erich E. Hoover <erich.e.hoover@gmail.com>
11//
12// To see a description of the changes please see the Changelog file that
13// came with your tarball or type make ChangeLog if you are building from git
14//
15//========================================================================
16
17//========================================================================
18//
19// Based on code from pdfinfo.cc
20//
21// Copyright 1998-2003 Glyph & Cog, LLC
22//
23//========================================================================
24
25#ifndef DATE_INFO_H
26#define DATE_INFO_H
27
28#include "goo/GooString.h"
29#include "poppler_private_export.h"
30#include <ctime>
31
32bool POPPLER_PRIVATE_EXPORT parseDateString(const GooString *date, int *year, int *month, int *day, int *hour, int *minute, int *second, char *tz, int *tzHour, int *tzMinute);
33
34/* Converts the time_t into a PDF Date format string.
35 * If timeA is NULL, current time is used.
36 * Returns new GooString. Free with delete.
37 */
38GooString POPPLER_PRIVATE_EXPORT *timeToDateString(const time_t *timeA);
39
40/* Converts the time_t into a string with the specified format.
41 * If timeA is NULL, current time is used.
42 * Returns std::string
43 */
44std::string POPPLER_PRIVATE_EXPORT timeToStringWithFormat(const time_t *timeA, const char *format);
45
46/* Convert PDF date string to time.
47 * Returns -1 if conversion fails.
48 */
49time_t POPPLER_PRIVATE_EXPORT dateStringToTime(const GooString *dateString);
50
51#endif
52

source code of poppler/poppler/DateInfo.h