Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/mongo/util/time_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace mongo {
std::string time_t_to_String(time_t t);
std::string time_t_to_String_short(time_t t);

struct Date_t {
struct MONGO_CLIENT_API Date_t {
// TODO: make signed (and look for related TODO's)
unsigned long long millis;
Date_t(): millis(0) {}
Expand All @@ -49,38 +49,38 @@ namespace mongo {

// uses ISO 8601 dates without trailing Z
// colonsOk should be false when creating filenames
std::string terseCurrentTime(bool colonsOk=true);
MONGO_CLIENT_API std::string terseCurrentTime(bool colonsOk=true);

/**
* Formats "time" according to the ISO 8601 extended form standard, including date,
* and time, in the UTC timezone.
*
* Sample format: "2013-07-23T18:42:14Z"
*/
std::string timeToISOString(time_t time);
MONGO_CLIENT_API std::string timeToISOString(time_t time);

/**
* Formats "date" according to the ISO 8601 extended form standard, including date,
* and time with milliseconds decimal component, in the UTC timezone.
*
* Sample format: "2013-07-23T18:42:14.072Z"
*/
std::string dateToISOStringUTC(Date_t date);
MONGO_CLIENT_API std::string dateToISOStringUTC(Date_t date);

/**
* Formats "date" according to the ISO 8601 extended form standard, including date,
* and time with milliseconds decimal component, in the local timezone.
*
* Sample format: "2013-07-23T18:42:14.072-05:00"
*/
std::string dateToISOStringLocal(Date_t date);
MONGO_CLIENT_API std::string dateToISOStringLocal(Date_t date);

/**
* Formats "date" in fixed width in the local time zone.
*
* Sample format: "Wed Oct 31 13:34:47.996"
*/
std::string dateToCtimeString(Date_t date);
MONGO_CLIENT_API std::string dateToCtimeString(Date_t date);

/**
* Parses a Date_t from an ISO 8601 string representation.
Expand All @@ -90,7 +90,7 @@ namespace mongo {
*
* Local times are currently not supported.
*/
StatusWith<Date_t> dateFromISOString(const StringData& dateString);
MONGO_CLIENT_API StatusWith<Date_t> dateFromISOString(const StringData& dateString);

boost::gregorian::date currentDate();

Expand Down