summaryrefslogtreecommitdiff
path: root/src/mongo/util/time_support.h
diff options
context:
space:
mode:
authorShaun Verch <shaun.verch@10gen.com>2013-10-11 18:10:35 -0400
committerShaun Verch <shaun.verch@10gen.com>2013-10-11 21:27:17 -0400
commit0b19be208f91e70c683d60c22011cad14a9fa78c (patch)
treeddfef3b5deadd9dc95157227172d2adda52b754d /src/mongo/util/time_support.h
parent34b88976c91fdeec5ff0b8816d35deef72f3767e (diff)
downloadmongo-0b19be208f91e70c683d60c22011cad14a9fa78c.tar.gz
SERVER-6058 Factor out date to UTC handling code and use in mongoexport
Diffstat (limited to 'src/mongo/util/time_support.h')
-rw-r--r--src/mongo/util/time_support.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/util/time_support.h b/src/mongo/util/time_support.h
index 46cee85e97a..1043a658142 100644
--- a/src/mongo/util/time_support.h
+++ b/src/mongo/util/time_support.h
@@ -78,6 +78,18 @@ namespace mongo {
*/
std::string dateToCtimeString(Date_t date);
+ /**
+ * Converts millis to time_t, doing correct division for negative millis, and uasserting that
+ * the result falls within the valid range of a time_t.
+ */
+ time_t millisToTimeT(long long millis);
+
+ /**
+ * Returns the millis since the last whole second of the given millis since epoch, and correctly
+ * handles dates before epoch.
+ */
+ int extractMillisPortion(long long millisSinceEpoch);
+
boost::gregorian::date currentDate();
// parses time of day in "hh:mm" format assuming 'hh' is 00-23