2
* @file date.h date formatting and parsing routines for Liferea
4
* Copyright (C) 2008-2009 Lars Lindner <lars.lindner@gmail.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
* Generic date formatting function. Uses either the
28
* user defined format string, or (if date_format is NULL)
29
* a formatted date string whose format string depends
30
* on the time difference to today.
32
* @param t the timestamp
33
* @param date_format NULL or a strptime format string (encoded in UTF-8)
35
* @returns a newly allocated formatted date string (encoded in UTF-8)
37
gchar * date_format (time_t date, const gchar *date_format);
40
* Parses a ISO8601 date.
42
* @param date the date string to parse
46
time_t date_parse_ISO8601 (const gchar *date);
49
* Parses a RFC822 format date. This FAILS if a timezone string is
50
* specified such as EDT or EST and that timezone is in daylight
53
* @param date the date string to parse
55
* @returns timestamp (GMT, no daylight savings time)
57
time_t date_parse_RFC822 (const gchar *date);