util_mit.cc File Reference

#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <ctype.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <iostream>
#include "util_mit.h"
#include "debug.h"

Include dependency graph for util_mit.cc:

Go to the source code of this file.

Defines

#define TOLOWER(c)   tolower((int) (c))
#define TOUPPER(c)   toupper((int) (c))

Functions

string date_time_str (time_t *calendar, bool local)
time_t parse_time (const char *str, bool expand)


Define Documentation

#define TOLOWER (  )     tolower((int) (c))

Definition at line 80 of file util_mit.cc.

#define TOUPPER (  )     toupper((int) (c))

Definition at line 81 of file util_mit.cc.


Function Documentation

string date_time_str ( time_t *  calendar,
bool  local 
)

Given a time in seconds since midnight 1 Jan 1970, return the RFC 1123 date string. Example result string: Sun, 06 Nov 1994 08:49:37 GMT

Parameters:
calendar Time in seconds
local If true, return the local time, if false return GMT. The default value is false.
Returns:
A RFC 1123 date string.

Definition at line 281 of file util_mit.cc.

time_t parse_time ( const char *  str,
bool  expand 
)

Parse a string in GMT format to a local time time_t representation Four formats are accepted: Wkd, 00 Mon 0000 00:00:00 GMT (rfc1123) Weekday, 00-Mon-00 00:00:00 GMT (rfc850) Wkd Mon 00 00:00:00 0000 GMT (ctime) 1*DIGIT (delta-seconds)

Copied from libwww. 09/19/02 jhrg

Parameters:
str The time string.
expand If the time is given in delta seconds, adjust it to seconds since midnight 1 Jan 1970 if this is true. If false, simply convert the string to a time_t and return. The default value is true.
Returns:
The time in seconds since midnight 1 Jan 1970.

Definition at line 129 of file util_mit.cc.

References DBG.


Generated on Wed Jun 27 12:57:15 2007 for libdap++ by  doxygen 1.4.7