NCBI C++ ToolKit
Classes | Macros | Typedefs | Enumerations | Enumerator | Functions | Variables | Friends
Time And Date
+ Collaboration diagram for Time And Date:

Classes

struct  TDBTimeU
 Database format for time where day and time is unsigned 16 bit. More...
 
struct  TDBTimeI
 Database format for time where day and time is signed 32 bit. More...
 
class  CTimeFormat
 CTimeFormat –. More...
 
class  CTime
 CTime –. More...
 
struct  CTime::TData
 
class  CCurrentTime
 CCurrentTime –. More...
 
class  CTimeSpan
 CTimeSpan. More...
 
class  CTimeout
 CTimeout – Timeout interval. More...
 
class  CNanoTimeout
 CNanoTimeout – Timeout interval, using nanoseconds. More...
 
class  CDeadline
 CDeadline. More...
 
class  CFastLocalTime
 CFastLocalTime –. More...
 
class  CStopWatch
 CStopWatch –. More...
 
class  CTimeException
 CTimeException –. More...
 

Macros

#define NCBI_TIME_BITFIELD(n)   : n
 
#define NCBI_TIME_EMPTY_BITFIELD   unsigned : 0;
 

Typedefs

typedef Int8 TSeconds
 Number of seconds. More...
 
typedef struct TDBTimeUTDBTimeUPtr
 
typedef struct TDBTimeITDBTimeIPtr
 
typedef unsigned int CTimeFormat::TFlags
 Binary OR of "EFlags". More...
 
typedef unsigned int CTimeSpan::TSmartStringFlags
 Binary OR of "ESmartStringFlags". More...
 
typedef CDeadline CAbsTimeout
 

Enumerations

enum  CTimeFormat::EFlags {
  CTimeFormat::fFormat_Simple = (1 << 0) , CTimeFormat::fFormat_Ncbi = (1 << 1) , CTimeFormat::fMatch_Strict = (1 << 5) , CTimeFormat::fMatch_ShortTime = (1 << 6) ,
  CTimeFormat::fMatch_ShortFormat = (1 << 7) , CTimeFormat::fMatch_Weak = fMatch_ShortTime | fMatch_ShortFormat , CTimeFormat::fMatch_IgnoreSpaces = (1 << 8) , CTimeFormat::fConf_UTC = (1 << 9) ,
  CTimeFormat::fDefault = 0 , CTimeFormat::eNcbiSimple = fFormat_Simple , CTimeFormat::eNcbi = fFormat_Ncbi , CTimeFormat::eDefault = fDefault
}
 Flags. More...
 
enum  CTimeFormat::EPredefined {
  CTimeFormat::eISO8601_Year = 0 , CTimeFormat::eISO8601_YearMonth = 1 , CTimeFormat::eISO8601_Date = 2 , CTimeFormat::eISO8601_DateTimeMin = 3 ,
  CTimeFormat::eISO8601_DateTimeSec = 4 , CTimeFormat::eISO8601_DateTimeFrac = 5
}
 Predefined formats. More...
 
enum  CTime::EInitMode { CTime::eCurrent , CTime::eEmpty }
 Which initial value to use for time. More...
 
enum  CTime::ETimeZone { CTime::eLocal = 1 , CTime::eUTC , CTime::eGmt = eUTC }
 Which initial value to use for timezone. More...
 
enum  { CTime::eCurrentTimeZone = -1 }
 Current timezone. Used in AsString() method. More...
 
enum  CTime::ENameFormat { CTime::eFull , CTime::eAbbr }
 Which format use to get name of month or week of day. More...
 
enum  CTime::EMonth {
  CTime::eJanuary = 1 , CTime::eFebruary , CTime::eMarch , CTime::eApril ,
  CTime::eMay , CTime::eJune , CTime::eJuly , CTime::eAugust ,
  CTime::eSeptember , CTime::eOctober , CTime::eNovember , CTime::eDecember
}
 Month names. More...
 
enum  CTime::EDayOfWeek {
  CTime::eSunday = 0 , CTime::eMonday , CTime::eTuesday , CTime::eWednesday ,
  CTime::eThursday , CTime::eFriday , CTime::eSaturday
}
 Day of week names. More...
 
enum  CTime::ETimeZonePrecision {
  CTime::eNone , CTime::eMinute , CTime::eHour , CTime::eDay ,
  CTime::eMonth , CTime::eTZPrecisionDefault = eNone
}
 What time zone precision to use for adjusting daylight saving time. More...
 
enum  CTime::EDaylight { CTime::eIgnoreDaylight , CTime::eAdjustDaylight , CTime::eDaylightDefault = eAdjustDaylight }
 Whether to adjust for daylight saving time. More...
 
enum  CTime::ERoundPrecision {
  CTime::eRound_Day , CTime::eRound_Hour , CTime::eRound_Minute , CTime::eRound_Second ,
  CTime::eRound_Millisecond , CTime::eRound_Microsecond
}
 Precision for rounding time. More...
 
enum  CTime::EErrAction { CTime::eErr_Throw , CTime::eErr_NoThrow }
 Defines how to behave on error. More...
 
enum  CTimeSpan::ESmartStringFlags {
  CTimeSpan::fSS_Year = (1 << 0) , CTimeSpan::fSS_Month = (1 << 1) , CTimeSpan::fSS_Day = (1 << 2) , CTimeSpan::fSS_Hour = (1 << 3) ,
  CTimeSpan::fSS_Minute = (1 << 4) , CTimeSpan::fSS_Second = (1 << 5) , CTimeSpan::fSS_Millisecond = (1 << 6) , CTimeSpan::fSS_Microsecond = (1 << 7) ,
  CTimeSpan::fSS_Nanosecond = (1 << 8) , CTimeSpan::fSS_Precision1 = (1 << 9) , CTimeSpan::fSS_Precision2 = (1 << 10) , CTimeSpan::fSS_Precision3 = (1 << 11) ,
  CTimeSpan::fSS_Precision4 = (1 << 12) , CTimeSpan::fSS_Precision5 = (1 << 13) , CTimeSpan::fSS_Precision6 = (1 << 14) , CTimeSpan::fSS_Precision7 = (1 << 15) ,
  CTimeSpan::fSS_Smart = (1 << 16) , CTimeSpan::fSS_PrecisionMask = 0x1FFFF , CTimeSpan::fSS_Round = (1 << 20) , CTimeSpan::fSS_Trunc = (1 << 21) ,
  CTimeSpan::fSS_NoSkipZero = (1 << 22) , CTimeSpan::fSS_SkipZero = (1 << 23) , CTimeSpan::fSS_Short = (1 << 24) , CTimeSpan::fSS_Full = (1 << 25) ,
  CTimeSpan::fSS_Default = 0
}
 AsSmartString() conversion flags. More...
 
enum  CTimeSpan::ESmartStringPrecision {
  CTimeSpan::eSSP_Year = fSS_Year , CTimeSpan::eSSP_Month = fSS_Month , CTimeSpan::eSSP_Day = fSS_Day , CTimeSpan::eSSP_Hour = fSS_Hour ,
  CTimeSpan::eSSP_Minute = fSS_Minute , CTimeSpan::eSSP_Second = fSS_Second , CTimeSpan::eSSP_Millisecond = fSS_Millisecond , CTimeSpan::eSSP_Microsecond = fSS_Microsecond ,
  CTimeSpan::eSSP_Nanosecond = fSS_Nanosecond , CTimeSpan::eSSP_Precision1 = fSS_Precision1 , CTimeSpan::eSSP_Precision2 = fSS_Precision2 , CTimeSpan::eSSP_Precision3 = fSS_Precision3 ,
  CTimeSpan::eSSP_Precision4 = fSS_Precision4 , CTimeSpan::eSSP_Precision5 = fSS_Precision5 , CTimeSpan::eSSP_Precision6 = fSS_Precision6 , CTimeSpan::eSSP_Precision7 = fSS_Precision7 ,
  CTimeSpan::eSSP_Smart = fSS_Smart
}
 Precision for span "smart" string. More...
 
enum  CTimeSpan::ESmartStringZeroMode { CTimeSpan::eSSZ_NoSkipZero = fSS_NoSkipZero , CTimeSpan::eSSZ_SkipZero = fSS_SkipZero }
 Which format use to output zero time span parts. More...
 
enum  CTimeout::EType { CTimeout::eFinite , CTimeout::eDefault , CTimeout::eInfinite , CTimeout::eZero }
 Type of timeouts. More...
 
enum  CDeadline::EType : unsigned { CDeadline::eInfinite = numeric_limits<unsigned>::max() , CDeadline::eNoWait = 0u }
 Type of special deadlines. More...
 
enum  CStopWatch::EStart { CStopWatch::eStart , CStopWatch::eStop }
 Defines how to create new timer. More...
 
enum  CTimeException::EErrCode { CTimeException::eArgument , CTimeException::eConvert , CTimeException::eInvalid , CTimeException::eFormat }
 Error types that CTime can generate. More...
 

Functions

 CTimeFormat::CTimeFormat (void)
 Default constructor. More...
 
 CTimeFormat::CTimeFormat (const CTimeFormat &fmt)
 Copy constructor. More...
 
 CTimeFormat::CTimeFormat (const char *fmt, TFlags flags=fDefault)
 Constructor. More...
 
 CTimeFormat::CTimeFormat (const string &fmt, TFlags flags=fDefault)
 Constructor. More...
 
CTimeFormatCTimeFormat::operator= (const CTimeFormat &fmt)
 Assignment operator. More...
 
void CTimeFormat::SetFormat (const char *fmt, TFlags flags=fDefault)
 Set the current time format. More...
 
void CTimeFormat::SetFormat (const string &fmt, TFlags flags=fDefault)
 Set the current time format. More...
 
const stringCTimeFormat::GetString (void) const
 Get format string. More...
 
TFlags CTimeFormat::GetFlags (void) const
 Get format flags. More...
 
bool CTimeFormat::IsEmpty (void) const
 Check that format string is empty. More...
 
static CTimeFormat CTimeFormat::GetPredefined (EPredefined fmt, TFlags flags=fDefault)
 Get predefined format. More...
 
 CTimeFormat::operator string (void) const
 Return time format as string. More...
 
 CTime::CTime (EInitMode mode=eEmpty, ETimeZone tz=eLocal, ETimeZonePrecision tzp=eTZPrecisionDefault)
 Constructor. More...
 
 CTime::CTime (time_t t, ETimeZonePrecision tzp=eTZPrecisionDefault)
 Conversion constructor for time_t representation of time. More...
 
 CTime::CTime (const struct tm &t, ETimeZonePrecision tzp=eTZPrecisionDefault)
 Conversion constructor for "struct tm" local time representation. More...
 
 CTime::CTime (int year, int month, int day, int hour=0, int minute=0, int second=0, long nanosecond=0, ETimeZone tz=eLocal, ETimeZonePrecision tzp=eTZPrecisionDefault)
 Constructor. More...
 
 CTime::CTime (int year, int yearDayNumber, ETimeZone tz=eLocal, ETimeZonePrecision tzp=eTZPrecisionDefault)
 Constructor. More...
 
 CTime::CTime (const string &str, const CTimeFormat &fmt=kEmptyStr, ETimeZone tz=eLocal, ETimeZonePrecision tzp=eTZPrecisionDefault)
 Explicit conversion constructor for string representation of time. More...
 
 CTime::CTime (const CTime &t)
 Copy constructor. More...
 
CTimeCTime::operator= (const CTime &t)
 Assignment operator. More...
 
CTimeCTime::operator= (const string &str)
 Assignment operator from string. More...
 
CTimeCTime::SetTimeT (const time_t t)
 Set time using time_t time value. More...
 
time_t CTime::GetTimeT (void) const
 Get time in time_t format. More...
 
static void CTime::GetCurrentTimeT (time_t *sec, long *nanosec=0)
 Get current UTC time in time_t format (with nanoseconds). More...
 
CTimeCTime::SetTimeTM (const struct tm &t)
 Set time using "struct tm" time value. More...
 
struct tm CTime::GetTimeTM (void) const
 Get time in "struct tm" format. More...
 
CTimeCTime::SetTimeDBU (const TDBTimeU &t)
 Set time using database format time, TDBTimeU. More...
 
CTimeCTime::SetTimeDBI (const TDBTimeI &t)
 Set time using database format time, TDBTimeI. More...
 
TDBTimeU CTime::GetTimeDBU (void) const
 Get time in database format time, TDBTimeU. More...
 
TDBTimeI CTime::GetTimeDBI (void) const
 Get time in database format time, TDBTimeI. More...
 
CTimeCTime::SetCurrent (void)
 Make the time current in the presently active time zone. More...
 
CTimeCTime::Clear (void)
 Make the time "empty",. More...
 
static void CTime::SetFormat (const CTimeFormat &fmt)
 Set the current time format. More...
 
static CTimeFormat CTime::GetFormat (void)
 Get the current time format. More...
 
static int CTime::MonthNameToNum (const string &month)
 Get numerical value of the month by name. More...
 
static string CTime::MonthNumToName (int month, ENameFormat format=eFull)
 Get name of the month by numerical value. More...
 
static int CTime::DayOfWeekNameToNum (const string &day)
 Get numerical value of the day of week by name. More...
 
static string CTime::DayOfWeekNumToName (int day, ENameFormat format=eFull)
 Get name of the day of week by numerical value. More...
 
string CTime::AsString (const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
 Transform time to string. More...
 
 CTime::operator string (void) const
 Return time as string using the format returned by GetFormat(). More...
 
int CTime::Year (void) const
 Get year. More...
 
int CTime::Month (void) const
 Get month. More...
 
int CTime::Day (void) const
 Get day. More...
 
int CTime::Hour (void) const
 Get hour. More...
 
int CTime::Minute (void) const
 Get minute. More...
 
int CTime::Second (void) const
 Get second. More...
 
long CTime::MilliSecond (void) const
 Get milliseconds. More...
 
long CTime::MicroSecond (void) const
 Get microseconds. More...
 
long CTime::NanoSecond (void) const
 Get nano-seconds. More...
 
void CTime::SetYear (int year)
 Set year. More...
 
void CTime::SetMonth (int month)
 Set month. More...
 
void CTime::SetDay (int day)
 Set day. More...
 
void CTime::SetHour (int hour)
 Set hour. More...
 
void CTime::SetMinute (int minute)
 Set minute. More...
 
void CTime::SetSecond (int second)
 Set second. More...
 
void CTime::SetMilliSecond (long millisecond)
 Set milliseconds. More...
 
void CTime::SetMicroSecond (long microsecond)
 Set microseconds. More...
 
void CTime::SetNanoSecond (long nanosecond)
 Set nanoseconds. More...
 
int CTime::YearDayNumber (void) const
 Get year's day number. More...
 
int CTime::YearWeekNumber (EDayOfWeek first_day_of_week=eSunday) const
 Get this date's week number within the year. More...
 
int CTime::MonthWeekNumber (EDayOfWeek first_day_of_week=eSunday) const
 Get this date's week number in the month. More...
 
int CTime::DayOfWeek (void) const
 Get day of week. More...
 
int CTime::DaysInMonth (void) const
 Get number of days in the month. More...
 
CTimeCTime::AddYear (int years=1, EDaylight adl=eDaylightDefault)
 Add specified years and adjust for daylight saving time. More...
 
CTimeCTime::AddMonth (int months=1, EDaylight adl=eDaylightDefault)
 Add specified months and adjust for daylight saving time. More...
 
CTimeCTime::AddDay (int days=1, EDaylight adl=eDaylightDefault)
 Add specified days and adjust for daylight saving time. More...
 
CTimeCTime::AddHour (int hours=1, EDaylight adl=eDaylightDefault)
 Add specified hours and adjust for daylight saving time. More...
 
CTimeCTime::AddMinute (int minutes=1, EDaylight adl=eDaylightDefault)
 Add specified minutes and adjust for daylight saving time. More...
 
CTimeCTime::AddSecond (TSeconds seconds=1, EDaylight adl=eDaylightDefault)
 Add specified seconds. More...
 
CTimeCTime::AddNanoSecond (long nanoseconds=1)
 Add specified nanoseconds. More...
 
CTimeCTime::AddTimeSpan (const CTimeSpan &timespan)
 Add specified time span. More...
 
CTimeCTime::Round (ERoundPrecision precision=eRound_Day, EDaylight adl=eDaylightDefault)
 Round time. More...
 
CTimeCTime::Truncate (ERoundPrecision precision=eRound_Day)
 Truncate time. More...
 
CTimeCTime::operator+= (const CTimeSpan &ts)
 
CTimeCTime::operator-= (const CTimeSpan &ts)
 Operator to subtract time span. More...
 
CTime CTime::operator+ (const CTimeSpan &ts) const
 
CTime CTime::operator- (const CTimeSpan &ts) const
 Operator to subtract time span. More...
 
CTimeSpan CTime::operator- (const CTime &t) const
 Operator to subtract times. More...
 
bool CTime::operator== (const CTime &t) const
 Operator to test equality of time. More...
 
bool CTime::operator!= (const CTime &t) const
 Operator to test in-equality of time. More...
 
bool CTime::operator> (const CTime &t) const
 Operator to test if time is later. More...
 
bool CTime::operator< (const CTime &t) const
 Operator to test if time is earlier. More...
 
bool CTime::operator>= (const CTime &t) const
 Operator to test if time is later or equal. More...
 
bool CTime::operator<= (const CTime &t) const
 Operator to test if time is earlier or equal. More...
 
int CTime::DiffWholeDays (const CTime &t) const
 Difference in whole days from specified time. More...
 
double CTime::DiffDay (const CTime &t) const
 Difference in days from specified time. More...
 
double CTime::DiffHour (const CTime &t) const
 Difference in hours from specified time. More...
 
double CTime::DiffMinute (const CTime &t) const
 Difference in minutes from specified time. More...
 
TSeconds CTime::DiffSecond (const CTime &t) const
 Difference in seconds from specified time. More...
 
double CTime::DiffNanoSecond (const CTime &t) const
 Difference in nanoseconds from specified time. More...
 
CTimeSpan CTime::DiffTimeSpan (const CTime &t) const
 Difference in nanoseconds from specified time. More...
 
bool CTime::IsEmpty (void) const
 Is time object empty (date and time)? More...
 
bool CTime::IsEmptyDate (void) const
 Is date empty? More...
 
bool CTime::IsLeap (void) const
 Is time in a leap year? More...
 
bool CTime::IsValid (void) const
 Is time valid? More...
 
bool CTime::IsLocalTime (void) const
 Is time local time? More...
 
bool CTime::IsUniversalTime (void) const
 Is time universal (GMT/UTC/Z)? More...
 
bool CTime::IsGmtTime (void) const
 
bool CTime::IsDST (void) const
 Is DST (daylight savings time) in effect for this time? More...
 
static bool CTime::ValidateString (const string &str, const CTimeFormat &fmt=kEmptyStr)
 Validate if string match time format. More...
 
ETimeZone CTime::GetTimeZone (void) const
 Get time zone. More...
 
ETimeZone CTime::GetTimeZoneFormat (void) const
 
ETimeZone CTime::SetTimeZone (ETimeZone val)
 Set time zone. More...
 
ETimeZone CTime::SetTimeZoneFormat (ETimeZone val)
 
ETimeZonePrecision CTime::GetTimeZonePrecision (void) const
 Get time zone precision. More...
 
ETimeZonePrecision CTime::SetTimeZonePrecision (ETimeZonePrecision val)
 Set time zone precision. More...
 
CTime CTime::GetLocalTime (void) const
 Get the time as local time. More...
 
CTime CTime::GetUniversalTime (void) const
 Get the time as universal (GMT/UTC) time. More...
 
CTime CTime::GetGmtTime (void) const
 
CTimeCTime::ToTime (ETimeZone val)
 Convert the time into specified time zone time. More...
 
CTimeCTime::ToLocalTime (void)
 Convert the time into local time. More...
 
CTimeCTime::ToUniversalTime (void)
 Convert the time into universal (GMT/UTC) time. More...
 
CTimeCTime::ToGmtTime (void)
 
TSeconds CTime::TimeZoneDiff (void) const
 Get difference between local timezone for current time object and UTC in seconds. More...
 
TSeconds CTime::TimeZoneOffset (void) const
 Get difference between local timezone for current time object and UTC in seconds. More...
 
string CTime::TimeZoneOffsetStr (void)
 Get time zone offset string in format [+/-]HHMM. More...
 
string CTime::TimeZoneName (void)
 Get current time zone name. More...
 
bool CTime::x_Init (const string &str, const CTimeFormat &fmt, EErrAction err_action=eErr_Throw)
 Helper method to set time value from string "str" using format "fmt". More...
 
CTimeCTime::x_SetTime (const time_t *t=0)
 Helper method to set time from 'time_t' – If "t" not specified, then set to current time. More...
 
CTimeCTime::x_SetTimeMTSafe (const time_t *t=0)
 Version of x_SetTime() with MT-safe locks. More...
 
void CTime::x_AdjustDay (void)
 Helper method to adjust day number to correct value after day manipulations. More...
 
CTimeCTime::x_AdjustTime (const CTime &from, bool shift_time=true)
 Helper method to adjust the time to correct timezone (across the barrier of winter & summer times) using "from" as a reference point. More...
 
CTimeCTime::x_AdjustTimeImmediately (const CTime &from, bool shift_time=true)
 Helper method to forcibly adjust timezone using "from" as a reference point. More...
 
bool CTime::x_NeedAdjustTime (void) const
 Helper method to check if there is a need adjust time in timezone. More...
 
CTimeCTime::x_AddHour (int hours=1, EDaylight daylight=eDaylightDefault, bool shift_time=true)
 Helper method to add hour with/without shift time. More...
 
 CCurrentTime::CCurrentTime (ETimeZone tz=eLocal)
 Constructor. More...
 
CCurrentTimeCCurrentTime::Update (void)
 Update current time. More...
 
 CTimeSpan::CTimeSpan (void)
 Default constructor. More...
 
 CTimeSpan::CTimeSpan (long days, long hours, long minutes, long seconds, long nanoseconds=0)
 Constructor. More...
 
 CTimeSpan::CTimeSpan (long seconds, long nanoseconds=0)
 Constructor. More...
 
 CTimeSpan::CTimeSpan (double seconds)
 Constructor. More...
 
 CTimeSpan::CTimeSpan (const string &str, const CTimeFormat &fmt=kEmptyStr)
 Explicit conversion constructor for string representation of time span. More...
 
 CTimeSpan::CTimeSpan (const CTimeSpan &t)
 Copy constructor. More...
 
CTimeSpanCTimeSpan::operator= (const CTimeSpan &t)
 Assignment operator. More...
 
CTimeSpanCTimeSpan::operator= (const string &str)
 Assignment operator. More...
 
CTimeSpanCTimeSpan::Clear (void)
 Make the time span "empty",. More...
 
ESign CTimeSpan::GetSign (void) const
 Get sign of time span. More...
 
static void CTimeSpan::SetFormat (const CTimeFormat &format)
 Set the current time span format. More...
 
static CTimeFormat CTimeSpan::GetFormat (void)
 Get the current time span format. More...
 
string CTimeSpan::AsString (const CTimeFormat &fmt=kEmptyStr) const
 Transform time span to string. More...
 
 CTimeSpan::operator string (void) const
 Return span time as string using the format returned by GetFormat(). More...
 
string CTimeSpan::AsSmartString (ESmartStringPrecision precision, ERound rounding, ESmartStringZeroMode zero_mode=eSSZ_SkipZero) const
 Transform time span to "smart" string. More...
 
string CTimeSpan::AsSmartString (TSmartStringFlags flags=0) const
 Transform time span to "smart" string. More...
 
CTimeSpanCTimeSpan::AssignFromSmartString (const string &str)
 Assign value to time span object from string representation of time in formats produced by AsSmartString(). More...
 
long CTimeSpan::GetCompleteDays (void) const
 Get number of complete days. More...
 
long CTimeSpan::GetCompleteHours (void) const
 Get number of complete hours. More...
 
long CTimeSpan::GetCompleteMinutes (void) const
 Get number of complete minutes. More...
 
long CTimeSpan::GetCompleteSeconds (void) const
 Get number of complete seconds. More...
 
long CTimeSpan::GetNanoSecondsAfterSecond (void) const
 Get number of nanoseconds. More...
 
double CTimeSpan::GetAsDouble (void) const
 Return time span as number of seconds. More...
 
bool CTimeSpan::IsEmpty (void) const
 Return TRUE is an object keep zero time span. More...
 
void CTimeSpan::Set (long seconds, long nanoseconds=0)
 Set time span in seconds and nanoseconds. More...
 
void CTimeSpan::Set (double seconds)
 Set time span from number of seconds (fractional value). More...
 
CTimeSpanCTimeSpan::operator+= (const CTimeSpan &t)
 
CTimeSpan CTimeSpan::operator+ (const CTimeSpan &t) const
 
CTimeSpanCTimeSpan::operator-= (const CTimeSpan &t)
 Operator to subtract time span. More...
 
CTimeSpan CTimeSpan::operator- (const CTimeSpan &t) const
 Operator to subtract time span. More...
 
CTimeSpan CTimeSpan::operator- (void) const
 Unary operator "-" (minus) to change time span sign. More...
 
void CTimeSpan::Invert (void)
 Invert time span. Changes time span sign. More...
 
bool CTimeSpan::operator== (const CTimeSpan &t) const
 Operator to test equality of time span. More...
 
bool CTimeSpan::operator!= (const CTimeSpan &t) const
 Operator to test in-equality of time span. More...
 
bool CTimeSpan::operator> (const CTimeSpan &t) const
 Operator to test if time span is greater. More...
 
bool CTimeSpan::operator< (const CTimeSpan &t) const
 Operator to test if time span is less. More...
 
bool CTimeSpan::operator>= (const CTimeSpan &t) const
 Operator to test if time span is greater or equal. More...
 
bool CTimeSpan::operator<= (const CTimeSpan &t) const
 Operator to test if time span is less or equal. More...
 
int CTimeSpan::x_Hour (void) const
 Get hour. More...
 
int CTimeSpan::x_Minute (void) const
 Get minute. More...
 
int CTimeSpan::x_Second (void) const
 Get second. More...
 
void CTimeSpan::x_Init (const string &str, const CTimeFormat &fmt)
 Helper method to set time value from string "str" using format "fmt". More...
 
void CTimeSpan::x_Normalize (void)
 Helper method to normalize stored time value. More...
 
string CTimeSpan::x_AsSmartString_Smart_Big (TSmartStringFlags flags) const
 Helpers for AsSmartString() More...
 
string CTimeSpan::x_AsSmartString_Smart_Small (TSmartStringFlags flags) const
 
string CTimeSpan::x_AsSmartString_Precision (TSmartStringFlags flags) const
 
 CTimeout::CTimeout (void)
 Create default timeout. More...
 
 CTimeout::CTimeout (EType type)
 Create timeout of specified type. More...
 
 CTimeout::CTimeout (const CTimeSpan &ts)
 Initialize timeout from CTimeSpan. More...
 
 CTimeout::CTimeout (unsigned int sec, unsigned int usec)
 Initialize timeout in seconds and microseconds. More...
 
 CTimeout::CTimeout (double sec)
 Initialize timeout from number of seconds (fractional value). More...
 
 CTimeout::~CTimeout (void)
 Destructor. More...
 
bool CTimeout::IsDefault () const
 
bool CTimeout::IsInfinite () const
 
bool CTimeout::IsZero () const
 
bool CTimeout::IsFinite () const
 Check if timeout holds a numeric value. More...
 
unsigned long CTimeout::GetAsMilliSeconds (void) const
 Get as number of milliseconds. More...
 
double CTimeout::GetAsDouble (void) const
 Get as number of seconds (fractional value). More...
 
CTimeSpan CTimeout::GetAsTimeSpan (void) const
 Convert to CTimeSpan. More...
 
void CTimeout::Get (unsigned int *sec, unsigned int *microsec) const
 Get timeout in seconds and microseconds. More...
 
void CTimeout::GetNano (unsigned int *sec, unsigned int *nanosec) const
 Get timeout in seconds and nanoseconds. More...
 
void CTimeout::Set (EType type)
 Set special value. More...
 
void CTimeout::Set (unsigned int sec, unsigned int microsec)
 Set timeout in seconds and microseconds. More...
 
void CTimeout::SetNano (unsigned int sec, unsigned int nanosec)
 Set timeout in seconds and nanoseconds. More...
 
void CTimeout::Set (double sec)
 Set timeout from number of seconds (fractional value). More...
 
void CTimeout::Set (const CTimeSpan &ts)
 Set from CTimeSpan. More...
 
bool CTimeout::operator== (const CTimeout &t) const
 Operator to test equality of timeouts. More...
 
bool CTimeout::operator!= (const CTimeout &t) const
 Operator to test in-equality of timeouts. More...
 
bool CTimeout::operator> (const CTimeout &t) const
 Operator to test if timeout is greater. More...
 
bool CTimeout::operator< (const CTimeout &t) const
 Operator to test if timeout is less. More...
 
bool CTimeout::operator>= (const CTimeout &t) const
 Operator to test if timeout is greater or equal. More...
 
bool CTimeout::operator<= (const CTimeout &t) const
 Operator to test if timeout is less or equal. More...
 
 CNanoTimeout::CNanoTimeout (unsigned int seconds, unsigned int nanoseconds)
 
 CDeadline::CDeadline (EType type=eNoWait)
 Initialize deadline of specified type. More...
 
 CDeadline::CDeadline (unsigned int rel_seconds, unsigned int rel_nanoseconds=0)
 Initialize deadline using seconds and nanoseconds (adding to the current time) More...
 
 CDeadline::CDeadline (const CTimeout &timeout)
 Initialize deadline by adding relative timeout to the current time. More...
 
bool CDeadline::IsInfinite (void) const
 Check if the deadline is infinite. More...
 
bool CDeadline::IsExpired (void) const
 Check if the deadline is expired. More...
 
void CDeadline::GetExpirationTime (time_t *sec, unsigned int *nanosec) const
 Get the number of seconds and nanoseconds (since 1/1/1970). More...
 
CNanoTimeout CDeadline::GetRemainingTime (void) const
 Get time left to the expiration. More...
 
bool CDeadline::operator< (const CDeadline &right_hand_operand) const
 Compare two CDeadline values. More...
 
 CDeadline::CDeadline (CTimeout::EType)
 
void CDeadline::x_SetNowPlus (unsigned int seconds, unsigned int nanoseconds)
 
 CFastLocalTime::CFastLocalTime (unsigned int sec_after_hour=5)
 Constructor. More...
 
CTime CFastLocalTime::GetLocalTime (void)
 Get local time. More...
 
int CFastLocalTime::GetLocalTimezone (void)
 Get difference in seconds between UTC and current local time (daylight information included) More...
 
void CFastLocalTime::Tuneup (void)
 Do unscheduled check. More...
 
bool CFastLocalTime::x_Tuneup (time_t timer, long nanosec)
 Internal version of Tuneup() More...
 
 CStopWatch::CStopWatch (EStart state=eStop)
 Constructor. More...
 
 CStopWatch::CStopWatch (bool start)
 Constructor. More...
 
void CStopWatch::Start (void)
 Start the timer. More...
 
double CStopWatch::Elapsed (void) const
 Return time elapsed since first Start() or last Restart() call (in seconds). More...
 
void CStopWatch::Stop (void)
 Suspend the timer. More...
 
double CStopWatch::Restart (void)
 Return time elapsed since first Start() or last Restart() call (in seconds). More...
 
void CStopWatch::Reset (void)
 Stop (if running) and reset the timer. More...
 
bool CStopWatch::IsRunning (void) const
 Check state of stopwatch. More...
 
static void CStopWatch::SetFormat (const CTimeFormat &fmt)
 Set the current stopwatch time format. More...
 
static CTimeFormat CStopWatch::GetFormat (void)
 Get the current stopwatch time format. More...
 
string CStopWatch::AsString (const CTimeFormat &fmt=kEmptyStr) const
 Transform stopwatch time to string. More...
 
 CStopWatch::operator string (void) const
 Return stopwatch time as string using the format returned by GetFormat(). More...
 
string CStopWatch::AsSmartString (CTimeSpan::ESmartStringPrecision precision, ERound rounding, CTimeSpan::ESmartStringZeroMode zero_mode=CTimeSpan::eSSZ_SkipZero) const
 Transform elapsed time to "smart" string. More...
 
string CStopWatch::AsSmartString (CTimeSpan::TSmartStringFlags flags=0) const
 Transform elapsed time to "smart" string. More...
 
static double CStopWatch::GetTimeMark ()
 Get current time mark. More...
 
virtual const char * CTimeException::GetErrCodeString (void) const override
 Translate from the error code value to its string representation. More...
 
 CTimeException::NCBI_EXCEPTION_DEFAULT (CTimeException, CCoreException)
 
CTime GetFastLocalTime (void)
 Quick and dirty getter of local time. More...
 
void TuneupFastLocalTime (void)
 
CTime AddYear (const CTime &t, int years=1)
 
CTime AddMonth (const CTime &t, int months=1)
 
CTime AddDay (const CTime &t, int days=1)
 
CTime AddHour (const CTime &t, int hours=1)
 
CTime AddMinute (const CTime &t, int minutes=1)
 
CTime AddSecond (const CTime &t, long seconds=1)
 
CTime AddNanoSecond (const CTime &t, long nanoseconds=1)
 
CTime operator+ (const CTimeSpan &ts, const CTime &t)
 
CTime CurrentTime (CTime::ETimeZone tz=CTime::eLocal, CTime::ETimeZonePrecision tzp=CTime::eTZPrecisionDefault)
 
CTime Truncate (const CTime &t)
 
ostream & operator<< (ostream &os, const CStopWatch &sw)
 Dumps the current stopwatch time to an output stream. More...
 
ostream & operator<< (ostream &os, const CTime &t)
 Dumps the current CTime time to an output stream. More...
 

Variables

const long kNanoSecondsPerSecond = 1000000000
 Number of nanoseconds in one second. More...
 
const long kMicroSecondsPerSecond = 1000000
 Number of microseconds in one second. More...
 
const long kMilliSecondsPerSecond = 1000
 Number milliseconds in one second. More...
 
const double kAverageDaysPerYear = 365.2425
 The average length of the year in the Gregorian (modern) calendar (in days) More...
 
const TSeconds kAverageSecondsPerYear = 31556952
 The average length of the year in the Gregorian (modern) calendar (in seconds) More...
 
const TSeconds kAverageSecondsPerMonth = kAverageSecondsPerYear/12
 
Uint2 TDBTimeU::days
 Days from 1/1/1900. More...
 
Uint2 TDBTimeU::time
 Minutes from the beginning of current day. More...
 
Int4 TDBTimeI::days
 days from 1/1/1900 More...
 
Int4 TDBTimeI::time
 x/300 seconds from the beginning of current day More...
 
string CTimeFormat::m_Str
 String format. More...
 
TFlags CTimeFormat::m_Flags
 Format flags. More...
 
unsigned int CTime::TData::year: 12
 
unsigned char CTime::TData::month: 4
 
unsigned char CTime::TData::day: 5
 
unsigned char CTime::TData::hour: 5
 
unsigned char CTime::TData::min: 6
 
unsigned char CTime::TData::sec: 6
 
Int4 CTime::TData::adjTimeDiff: 18
 
ETimeZone CTime::TData::tz: 3
 
ETimeZonePrecision CTime::TData::tzprec: 4
 
unsigned CTime::TData::__pad0__: 0
 
Int4 CTime::TData::nanosec
 
TData CTime::m_Data
 Packed members. More...
 
long CTimeSpan::m_Sec
 Seconds part of the time span. More...
 
long CTimeSpan::m_NanoSec
 Nanoseconds after the second. More...
 
EType CTimeout::m_Type
 Type of timeout. More...
 
unsigned int CTimeout::m_Sec
 Seconds part of the timeout. More...
 
unsigned int CTimeout::m_NanoSec
 Nanoseconds part of the timeout. More...
 
time_t CDeadline::m_Seconds
 
unsigned int CDeadline::m_Nanoseconds
 
bool CDeadline::m_Infinite
 
unsigned int CFastLocalTime::m_SecAfterHour
 Time interval in seconds after hour. More...
 
CTime CFastLocalTime::m_LocalTime
 Current local time. More...
 
CTime CFastLocalTime::m_TunedTime
 Last tuned time (changed by Tuneup()) More...
 
time_t CFastLocalTime::m_LastTuneupTime
 Last Tuneup() time. More...
 
time_t CFastLocalTime::m_LastSysTime
 Last system time. More...
 
int CFastLocalTime::m_Timezone
 Cached timezone adjustment for local time. More...
 
int CFastLocalTime::m_Daylight
 Cached system daylight information. More...
 
void *volatile CFastLocalTime::m_IsTuneup
 (bool) Tuneup() in progress (MT) More...
 
double CStopWatch::m_Start
 Start time value. More...
 
double CStopWatch::m_Total
 Accumulated elapsed time. More...
 
EStart CStopWatch::m_State
 Stopwatch state (started/stopped) More...
 

Friends

class CTime::CFastLocalTime
 

Detailed Description

Macro Definition Documentation

◆ NCBI_TIME_BITFIELD

#define NCBI_TIME_BITFIELD (   n)    : n

Definition at line 1243 of file ncbitime.hpp.

◆ NCBI_TIME_EMPTY_BITFIELD

#define NCBI_TIME_EMPTY_BITFIELD   unsigned : 0;

Definition at line 1244 of file ncbitime.hpp.

Typedef Documentation

◆ CAbsTimeout

Deprecated:
Use CDeadline instead

Definition at line 1880 of file ncbitime.hpp.

◆ TDBTimeIPtr

typedef struct TDBTimeI * TDBTimeIPtr

◆ TDBTimeUPtr

typedef struct TDBTimeU * TDBTimeUPtr

◆ TFlags

typedef unsigned int CTimeFormat::TFlags

Binary OR of "EFlags".

Definition at line 185 of file ncbitime.hpp.

◆ TSeconds

typedef Int8 TSeconds

Number of seconds.

Definition at line 80 of file ncbitime.hpp.

◆ TSmartStringFlags

Binary OR of "ESmartStringFlags".

Definition at line 1499 of file ncbitime.hpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Current timezone. Used in AsString() method.

Enumerator
eCurrentTimeZone 

Definition at line 312 of file ncbitime.hpp.

◆ EDaylight

Whether to adjust for daylight saving time.

Enumerator
eIgnoreDaylight 

Ignore daylight saving time.

eAdjustDaylight 

Adjust for daylight saving time.

eDaylightDefault 

Definition at line 367 of file ncbitime.hpp.

◆ EDayOfWeek

Day of week names.

Enumerator
eSunday 
eMonday 
eTuesday 
eWednesday 
eThursday 
eFriday 
eSaturday 

Definition at line 339 of file ncbitime.hpp.

◆ EErrAction

enum CTime::EErrAction
private

Defines how to behave on error.

Enumerator
eErr_Throw 

Throw an exception on error.

eErr_NoThrow 

Return default value on error.

Definition at line 1193 of file ncbitime.hpp.

◆ EErrCode

Error types that CTime can generate.

Enumerator
eArgument 

Bad function argument.

eConvert 

Error converting value from one format to another.

eInvalid 

Invalid time value.

eFormat 

Incorrect format.

Definition at line 2078 of file ncbitime.hpp.

◆ EFlags

Flags.

Note
It not specified otherwise, format have fDefault value "by default", that mean simple format string and strict matching.
See also
SetFormat, AsString
Enumerator
fFormat_Simple 

Use single characters as format symbols.

(default)

fFormat_Ncbi 

Specify each format symbol with a preceding symbol '$'.

This can be useful if your format string includes output characters that otherwise can be treated as format symbols. To include symbol '$' use '$$'.

fMatch_Strict 

A time string should strictly match the format string.

eg "Y" and "1997"

fMatch_ShortTime 

A time/format string can have extra trailing format symbols, that do not have matching symbols in the time string.

Any missed time components will be initialized by default in the time object. eg "Y/M/D h:m:s" and "1997"

fMatch_ShortFormat 

eg "Y" and "1997/07/16"

fMatch_Weak 

Combination of both modes above.

Note that it matches until time or format string have symbols. It not allow unprocessed symbols left in both time and format strings at the same time.

fMatch_IgnoreSpaces 

Ignore all white spaces in the time and format strings on the matching/parsing step (CTime only).

Use it for backward compatibility with old code only. Don't recommended to use, can lead to odd results and incorrect time on parsing some time strings.

fConf_UTC 

Prefer "UTC" over "GMT" abbreviation for universal time.

Used for output purposes only, parsing accept both.

fDefault 

Default flags.

eNcbiSimple 

"Enum"s, used for backward compatibility. Please use flags instead.

eNcbi 
eDefault 

Definition at line 139 of file ncbitime.hpp.

◆ EInitMode

Which initial value to use for time.

Enumerator
eCurrent 

Use current time. See also CCurrentTime.

eEmpty 

Use "empty" time.

Definition at line 299 of file ncbitime.hpp.

◆ EMonth

Month names.

Enumerator
eJanuary 
eFebruary 
eMarch 
eApril 
eMay 
eJune 
eJuly 
eAugust 
eSeptember 
eOctober 
eNovember 
eDecember 

Definition at line 323 of file ncbitime.hpp.

◆ ENameFormat

Which format use to get name of month or week of day.

Enumerator
eFull 

Use full name.

eAbbr 

Use abbreviated name.

Definition at line 317 of file ncbitime.hpp.

◆ EPredefined

Predefined formats.

See also
GetPredefined, CTime::SetFormat
Enumerator
eISO8601_Year 

Y (eg 1997)

eISO8601_YearMonth 

Y-M (eg 1997-07)

eISO8601_Date 

Y-M-D (eg 1997-07-16)

eISO8601_DateTimeMin 

Y-M-DTh:m (eg 1997-07-16T19:20)

eISO8601_DateTimeSec 

Y-M-DTh:m:s (eg 1997-07-16T19:20:30)

eISO8601_DateTimeFrac 

Y-M-DTh:m:g (eg 1997-07-16T19:20:30.1234)

Definition at line 190 of file ncbitime.hpp.

◆ ERoundPrecision

Precision for rounding time.

See also
Round, Truncate
Enumerator
eRound_Day 

Round to days.

eRound_Hour 

Round to hours.

eRound_Minute 

Round to minutes.

eRound_Second 

Round to seconds.

eRound_Millisecond 

Round to milliseconds.

eRound_Microsecond 

Round to microseconds.

Definition at line 982 of file ncbitime.hpp.

◆ ESmartStringFlags

AsSmartString() conversion flags.

Attention
Use one flag in each group only, or CTimeException exception will be thrown. If not specified otherwise default value will be used.
See also
AsSmartString
Enumerator
fSS_Year 

Round to years.

Note
precision Flags describing how many parts of time span should be returned.
  • Values from fSS_Year to fSS_Nanosecond apparently describe part of time span which will be last in output string.
  • Floating precision levels fSS_PrecisionN say that only up to 'N' of most significant parts of time span will be printed. The parts counting begin from first non-zero value.
  • fSS_Smart is default, it tries to represent time span as close and short as possible, usually using only one or two most significant non-zero parts of the time span.
fSS_Month 

Round to months.

fSS_Day 

Round to days.

fSS_Hour 

Round to hours.

fSS_Minute 

Round to minutes.

fSS_Second 

Round to seconds.

fSS_Millisecond 

Round to milliseconds.

fSS_Microsecond 

Round to microseconds.

fSS_Nanosecond 

Do not round at all (accurate time span)

fSS_Precision1 

Floating precision level 1.

fSS_Precision2 

Floating precision level 2.

fSS_Precision3 

Floating precision level 3.

fSS_Precision4 

Floating precision level 4.

fSS_Precision5 

Floating precision level 5.

fSS_Precision6 

Floating precision level 6.

fSS_Precision7 

Floating precision level 7.

fSS_Smart 

Be as smart as possible (see above)

fSS_PrecisionMask 

Mask of precision flags (sum of all above)

fSS_Round 
Note
rounding Rounding flags. By default time span will be truncated at last value specified by precision. If fSS_Round specified, that time span will be arithmetically rounded by precision level.
fSS_Trunc 
fSS_NoSkipZero 
Note
zero parts Flags to print or skip zero parts of time span which should be printed but have 0 value. Apply to middle and trailing zero parts of time span only. Leading zeros will be ignored in common case in any mode, they can be printed only if it is impossible to represent time span otherwise.
Attention
fSS_NoSkipZero is not compatible with fSS_Smart (exception will be thrown).
fSS_SkipZero 
fSS_Short 
Note
naming Specify what kind of names use for output time components, short standard abbreviations for time component like "m", or full "minutes".
fSS_Full 
fSS_Default 

Default flags.

Definition at line 1440 of file ncbitime.hpp.

◆ ESmartStringPrecision

Precision for span "smart" string.

Used in AsSmartString() method.

Deprecated:
Use ESmartStringFlags instead
Enumerator
eSSP_Year 
eSSP_Month 
eSSP_Day 
eSSP_Hour 
eSSP_Minute 
eSSP_Second 
eSSP_Millisecond 
eSSP_Microsecond 
eSSP_Nanosecond 
eSSP_Precision1 
eSSP_Precision2 
eSSP_Precision3 
eSSP_Precision4 
eSSP_Precision5 
eSSP_Precision6 
eSSP_Precision7 
eSSP_Smart 

Definition at line 1503 of file ncbitime.hpp.

◆ ESmartStringZeroMode

Which format use to output zero time span parts.

Deprecated:
Use ESmartStringFlags instead
Enumerator
eSSZ_NoSkipZero 

Print zero valued parts.

eSSZ_SkipZero 

Skip zero valued parts.

Definition at line 1526 of file ncbitime.hpp.

◆ EStart

Defines how to create new timer.

Enumerator
eStart 

Start timer immediately after creating.

eStop 

Do not start timer, just create it.

Definition at line 1940 of file ncbitime.hpp.

◆ ETimeZone

Which initial value to use for timezone.

Enumerator
eLocal 

Local time.

eUTC 

UTC (Universal Coordinated Time)

eGmt 

GMT (Greenwich Mean Time)

Definition at line 305 of file ncbitime.hpp.

◆ ETimeZonePrecision

What time zone precision to use for adjusting daylight saving time.

Controls when (if ever) to adjust for the daylight saving time (only if the time is represented in local timezone format).

NOTE: if diff between previous time value and the time after manipulation is greater than this range, then try apply daylight saving conversion on the result time value.

Enumerator
eNone 

Daylight saving not to affect time manipulations.

eMinute 

Check condition - new minute.

eHour 

Check condition - new hour.

eDay 

Check condition - new day.

eMonth 

Check condition - new month.

eTZPrecisionDefault 

Definition at line 357 of file ncbitime.hpp.

◆ EType [1/2]

Type of timeouts.

Enumerator
eFinite 

A finite timeout value has been set.

eDefault 

Default timeout (to be interpreted by the client code)

eInfinite 

Infinite timeout.

eZero 

Zero timeout, equal to CTimeout(0,0).

Definition at line 1696 of file ncbitime.hpp.

◆ EType [2/2]

enum CDeadline::EType : unsigned

Type of special deadlines.

Enumerator
eInfinite 

Infinite deadline.

eNoWait 

No-wait, expires immediately.

Definition at line 1833 of file ncbitime.hpp.

Function Documentation

◆ AddDay() [1/2]

CTime AddDay ( const CTime t,
int  days = 1 
)
inline

Definition at line 2136 of file ncbitime.hpp.

References t, and tmp.

◆ AddDay() [2/2]

CTime & CTime::AddDay ( int  days = 1,
EDaylight  adl = eDaylightDefault 
)

Add specified days and adjust for daylight saving time.

Parameters
daysDays to add. Default is 1 day. If negative, it will result in a "subtraction" operation.
adlWhether to adjust for daylight saving time. Default is to adjust for daylight saving time. This parameter is for eLocal time zone and where the time zone precision is not eNone.

Definition at line 1788 of file ncbitime.cpp.

References CTime::CTime(), CTime::eAdjustDaylight, CTime::IsEmptyDate(), kEmptyStr, NCBI_THROW, s_Date2Number(), s_Number2Date(), CTime::x_AdjustTime(), and CTime::x_NeedAdjustTime().

Referenced by CTime::Round(), CTime::SetTimeDBI(), CTime::SetTimeDBU(), and CTime::x_AddHour().

◆ AddHour() [1/2]

CTime AddHour ( const CTime t,
int  hours = 1 
)
inline

Definition at line 2143 of file ncbitime.hpp.

References t, and tmp.

◆ AddHour() [2/2]

CTime & CTime::AddHour ( int  hours = 1,
EDaylight  adl = eDaylightDefault 
)
inline

Add specified hours and adjust for daylight saving time.

Parameters
hoursHours to add. Default is 1 hour. If negative, it will result in a "subtraction" operation.
adlWhether to adjust for daylight saving time. Default is to adjust for daylight saving time. This parameter is for eLocal time zone and where the time zone precision is not eNone.

Definition at line 2371 of file ncbitime.hpp.

References CTime::x_AddHour().

Referenced by CTime::AddMinute(), CPileUpGraph::CPileUpGraph(), CSparseGraph::CSparseGraph(), and CTime::Round().

◆ AddMinute() [1/2]

CTime AddMinute ( const CTime t,
int  minutes = 1 
)
inline

Definition at line 2150 of file ncbitime.hpp.

References t, and tmp.

◆ AddMinute() [2/2]

CTime & CTime::AddMinute ( int  minutes = 1,
EDaylight  adl = eDaylightDefault 
)

Add specified minutes and adjust for daylight saving time.

Parameters
minutesMinutes to add. Default is 1 minute. If negative, it will result in a "subtraction" operation.
adlWhether to adjust for daylight saving time. Default is to adjust for daylight saving time. This parameter is for eLocal time zone and where the time zone precision is not eNone.

Definition at line 1850 of file ncbitime.cpp.

References CTime::AddHour(), CTime::CTime(), CTime::eAdjustDaylight, CTime::eIgnoreDaylight, CTime::IsEmptyDate(), kEmptyStr, CTime::Minute(), NCBI_THROW, s_Offset(), SET_MIN, CTime::x_AdjustTime(), and CTime::x_NeedAdjustTime().

Referenced by CTime::AddSecond(), CTime::Round(), and CTime::SetTimeDBU().

◆ AddMonth() [1/2]

CTime AddMonth ( const CTime t,
int  months = 1 
)
inline

Definition at line 2129 of file ncbitime.hpp.

References months, t, and tmp.

◆ AddMonth() [2/2]

CTime & CTime::AddMonth ( int  months = 1,
EDaylight  adl = eDaylightDefault 
)

Add specified months and adjust for daylight saving time.

Beware that this operation is inherently inconsistent. In case of different number of days in the months, the day number can change, e.g.:

  • "Dec 31 2000".AddMonth(2) => "Feb 28 2001" ("Feb 29" if leap year). Therefore e.g. calling AddMonth(1) 12 times for e.g. "Jul 31" will result in "Jul 28" (or "Jul 29") of the next year.
    Parameters
    monthsMonths to add. Default is 1 month. If negative, it will result in a "subtraction" operation.
    adlWhether to adjust for daylight saving time. Default is to adjust for daylight savings time. This parameter is for eLocal time zone and where the time zone precision is not eNone.

Definition at line 1757 of file ncbitime.cpp.

References CTime::CTime(), CTime::eAdjustDaylight, CTime::IsEmptyDate(), kEmptyStr, CTime::Month(), months, NCBI_THROW, s_Offset(), SET_MONTH, SET_YEAR, CTime::x_AdjustDay(), CTime::x_AdjustTime(), CTime::x_NeedAdjustTime(), and CTime::Year().

Referenced by CTime::AddYear().

◆ AddNanoSecond() [1/2]

CTime AddNanoSecond ( const CTime t,
long  nanoseconds = 1 
)
inline

Definition at line 2164 of file ncbitime.hpp.

References t, and tmp.

◆ AddNanoSecond() [2/2]

CTime & CTime::AddNanoSecond ( long  nanoseconds = 1)

Add specified nanoseconds.

Parameters
nanosecondsNanoseconds to add. Default is 1 nanosecond. If negative, it will result in a "subtraction" operation.

Definition at line 1896 of file ncbitime.cpp.

References CTime::AddSecond(), CTime::IsEmptyDate(), kNanoSecondsPerSecond, CTime::m_Data, CTime::TData::nanosec, CTime::NanoSecond(), NCBI_THROW, and s_Offset().

Referenced by CTime::AddTimeSpan(), CSimpleRebalanceStrategy::NeedRebalance(), and CTime::SetTimeDBI().

◆ AddSecond() [1/2]

CTime AddSecond ( const CTime t,
long  seconds = 1 
)
inline

Definition at line 2157 of file ncbitime.hpp.

References t, and tmp.

◆ AddSecond() [2/2]

CTime & CTime::AddSecond ( TSeconds  seconds = 1,
EDaylight  adl = eDaylightDefault 
)

◆ AddTimeSpan()

CTime & CTime::AddTimeSpan ( const CTimeSpan timespan)

Add specified time span.

Parameters
timespanObject of CTimeSpan class to add. If negative, it will result in a "subtraction" operation.

Definition at line 1912 of file ncbitime.cpp.

References CTime::AddNanoSecond(), CTime::AddSecond(), eZero, CTimeSpan::GetCompleteSeconds(), CTimeSpan::GetNanoSecondsAfterSecond(), and CTimeSpan::GetSign().

Referenced by CTime::operator+=(), CTime::operator-=(), and CReader::SetNewConnectionDelayMicroSec().

◆ AddYear() [1/2]

CTime AddYear ( const CTime t,
int  years = 1 
)
inline

Definition at line 2122 of file ncbitime.hpp.

References t, and tmp.

◆ AddYear() [2/2]

CTime & CTime::AddYear ( int  years = 1,
EDaylight  adl = eDaylightDefault 
)
inline

Add specified years and adjust for daylight saving time.

It is an exact equivalent of calling AddMonth(years * 12).

See also
AddMonth

Definition at line 2292 of file ncbitime.hpp.

References CTime::AddMonth().

Referenced by CCgiSession::GetSessionCookie(), and CCgiResponse::SetTrackingCookie().

◆ AssignFromSmartString()

CTimeSpan & CTimeSpan::AssignFromSmartString ( const string str)

Assign value to time span object from string representation of time in formats produced by AsSmartString().

Parameters
strString representation of time span in the format produced by AsSmartString(). All numeric time parts should have letter/word specifiers. The string should represent "positive" timespan, the sign (minus) is not allowed there.
See also
AsSmartString
Note
It use the average length of the year in the Gregorian (modern) calendar (365.2425 days) to convert years and months.

Definition at line 3263 of file ncbitime.cpp.

References _ASSERT, _TROUBLE, CTimeSpan::Clear(), eDay, eHour, eMicrosecond, eMillisecond, eMinute, eMonth, eNanosecond, eSecond, eYear, i, isalpha(), isdigit(), isspace(), kNanoSecondsPerSecond, kTimeSpanUnitMultipliers, kUnitCount, kUnitNames, CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, n, NCBI_THROW, NStr::NumericToString(), str(), NStr::StringToULong(), NStr::ToLower(), rapidjson::value, and CTimeSpan::x_Normalize().

Referenced by CNcbiApplogApp::Run().

◆ AsSmartString() [1/4]

string CStopWatch::AsSmartString ( CTimeSpan::ESmartStringPrecision  precision,
ERound  rounding,
CTimeSpan::ESmartStringZeroMode  zero_mode = CTimeSpan::eSSZ_SkipZero 
) const
inline

Transform elapsed time to "smart" string.

For more details see CTimeSpan::AsSmartString().

Parameters
precisionEnum value describing how many parts of time span should be returned.
roundingRounding mode.
zero_modeMode to print or skip zero parts of time span.
Returns
A string representation of elapsed time span.
See also
CTimeSpan::AsSmartString, AsString, Elapsed
Deprecated:
Use AsSmartString(TSmartStringFlags) instead.

Definition at line 2850 of file ncbitime.hpp.

References CTimeSpan::AsSmartString(), CStopWatch::Elapsed(), eRound, CTimeSpan::eSSZ_NoSkipZero, flags, CTimeSpan::fSS_NoSkipZero, CTimeSpan::fSS_Round, CTimeSpan::fSS_SkipZero, CTimeSpan::fSS_Trunc, and precision.

Referenced by CBlastDbBioseqSource::CBlastDbBioseqSource(), CNetBLASTUIDataSource::Close(), CConnTestThread::Main(), CSeqGraphicWidget::OnDataChanged(), CAppDialogs::OpenViewlDialog(), CAnnotMetaDataJob::Run(), CBlastVdbCmdApp::x_FormatRuntime(), CNAUtils::x_GetAllNAIds(), CNAUtils::x_GetNAMetaData(), and BlastdbCopyApplication::x_MakeDBwIDList().

◆ AsSmartString() [2/4]

string CStopWatch::AsSmartString ( CTimeSpan::TSmartStringFlags  flags = 0) const
inline

Transform elapsed time to "smart" string.

For more details see CTimeSpan::AsSmartString().

Parameters
flagsHow to convert string to value.
Returns
A string representation of elapsed time span.
See also
CTimeSpan::AsSmartString, AsString, Elapsed

Definition at line 2866 of file ncbitime.hpp.

References CTimeSpan::AsSmartString(), CStopWatch::Elapsed(), and flags.

◆ AsSmartString() [3/4]

string CTimeSpan::AsSmartString ( ESmartStringPrecision  precision,
ERound  rounding,
ESmartStringZeroMode  zero_mode = eSSZ_SkipZero 
) const
inline

◆ AsSmartString() [4/4]

string CTimeSpan::AsSmartString ( TSmartStringFlags  flags = 0) const

◆ AsString() [1/3]

string CTimeSpan::AsString ( const CTimeFormat fmt = kEmptyStr) const

◆ AsString() [2/3]

string CStopWatch::AsString ( const CTimeFormat fmt = kEmptyStr) const

Transform stopwatch time to string.

According to used OS, the double representation can provide much finer grained time control. The string representation is limited by nanoseconds.

Parameters
fmtIf format is not defined, then GetFormat() will be used. Format specifier used to convert value returned by Elapsed() to string.
See also
CTimeSpan::AsString, CTimeFormat, Elapsed, GetFormat, SetFormat

Definition at line 4149 of file ncbitime.cpp.

References CTimeSpan::AsString(), CStopWatch::Elapsed(), CStopWatch::GetFormat(), and CTimeFormat::IsEmpty().

Referenced by CMacroWorker::ExecuteMacros(), CDiagContext::GetProperty(), operator<<(), and CSequenceInputStats::PrintReport().

◆ AsString() [3/3]

string CTime::AsString ( const CTimeFormat format = kEmptyStr,
TSeconds  out_tz = eCurrentTimeZone 
) const

Transform time to string.

Parameters
formatFormat specifier used to convert time to string. If "format" is not defined, then GetFormat() will be used.
out_tzOutput timezone. This is a difference in seconds between universal and local time for some place (for example, for EST5 timezone its value is 18000). This parameter works only with local time. If the time object contains universal (GMT/UTC/Z) time it is ignored. Before doing transformation to string, the time will be converted to the output timezone. Timezone can be printed as a string 'GMT/UTC/Z[+|-]HHMM' using the format symbol 'z'. By default the current timezone is used.
See also
GetFormat, SetFormat

Definition at line 1512 of file ncbitime.cpp.

References STzFormatMake::activate(), STzFormatMake::active(), CTime::AddSecond(), CTime::CTime(), DSTBias, CTime::eCurrentTimeZone, ERR_POST_X, f, CTimeFormat::fConf_UTC, CTimeFormat::fFormat_Simple, format, CTime::GetFormat(), CTime::IsEmpty(), CTime::IsUniversalTime(), CTime::IsValid(), ITERATE, kEmptyStr, kFormatEscapeSymbol, kMonthAbbr, kMonthFull, kWeekdayAbbr, kWeekdayFull, NCBI_THROW, NPOS, s_AddInt(), s_AddZeroPadInt(), s_AddZeroPadInt2(), s_IsDST(), s_TimeDump(), str(), STzFormatMake::str(), t, and TimeZone.

Referenced by CRtProfiler::AddMarkerMT(), SThrottleStats::Adjust(), Convert::CassValueConvert< string >(), CBuildDatabase::CBuildDatabase(), CDbapiSampleApp::CDbapiSampleApp(), CNCHeartBeat::CheckConfFile(), CCgiStatistics::Compose_Timing(), CApplogUrl::ComposeUrl(), CPepXML::ConvertFromOMSSA(), CFeatureGenerator::ConvertLocToAnnot(), CWriteDB_ColumnIndex::CWriteDB_ColumnIndex(), CWriteDB_ConsolidateAliasFiles(), CWriteDB_CreateAliasFile(), CWriteDB_GiMaskIndex::CWriteDB_GiMaskIndex(), CWriteDB_Impl::CWriteDB_Impl(), CDbapiSimpleApp::DemoDynamicSql(), CSdbapiSimpleApp::DemoDynamicSql(), CwxLogDiagHandler::DoLogRecord(), CBDB_Cache::EvaluateTimeLine(), CDbapiTestSpeedApp::FetchFile(), CFeedbackReport::Format(), CProjBulderApp::GenerateUnixProjects(), CAlignFormatUtil::GetBlastDbInfo(), CSeqDB::GetDBMetaData(), CHttpCookie::GetExpirationStr(), CGBenchVersionInfo::GetLabel(), GetNetBlastJobDescription(), CELink_Request::GetQueryString(), CESearch_Request::GetQueryString(), CFileModules::GetRefInfo(), CVariant::GetString(), SLazyInitData::GetTime(), CEventViewModel::GetValueAt(), NS_FormatPreciseTime(), NST_FormatPreciseTime(), CPubseqGatewayApp::OnInfo(), operator<<(), CCgi2RCgiApp::PopulatePage(), CPerfLogger::Post(), CWNJobWatcher::Print(), CGridCommandLineInterfaceApp::PrintBlobMeta(), CSplitCacheApp::PrintVersion(), CBDB_Cache::Purge(), CCkblastindexApplication::Run(), CBlastKmerBuildIndexApplication::Run(), CXcompareAnnotsApplication::Run(), CAsnSubCacheCreateApplication::Run(), COcbdDemoApp::Run(), CCtlLibDemoAPp::RunSample(), s_ConvertV4toV5(), s_ConvertValue(), s_CreateAliasFilePriv(), s_DumpHeader(), s_ExpandProjectFolder(), s_FormatDate(), s_GetBlobMeta(), s_ListProjectFolder(), CGenBankLoadOptionPanel::SaveMruAccessions(), CProjectService::SaveSettings(), CFileLoadManager::SaveSettings(), CFileLoadMRUList::SaveToStrings(), CCgiResponse::SetHeaderValue(), CDate::SetToTime(), sFormatTimePeriod(), IBISInteraction::ToAlignAnnot(), CBlobStatusHistoryRecord::ToString(), CNetBlastJobDescriptor::ToUserObject(), CFeatureGenerator::SImplementation::TransformProteinAlignToTranscript(), WriteBlastSeqidlistFile(), CBlastDBAliasApp::x_AddVDBsToAliasFile(), CRotatingLogStream::x_BackupName(), CMessageSlotPopupWindow::x_CreateMessageSlotPanel(), CFeatureGenerator::SImplementation::x_CreateMrnaBioseq(), CCreateNeedlemanWunschJob::x_CreateProjectItems(), CFeatureGenerator::SImplementation::x_CreateProteinBioseq(), CAsnSubCacheCreateApplication::x_GetBioseqHandle(), CAgpFastaComparator::CTmpSeqVecStorage::x_GetTmpDir(), SDiagMessage::x_OldWrite(), CNetScheduleHandler::x_ProcessHealth(), CNetScheduleHandler::x_ProcessStatistics(), and CStartItem::x_SetDate().

◆ CCurrentTime()

CCurrentTime::CCurrentTime ( ETimeZone  tz = eLocal)
inline

Constructor.

Parameters
tzWhether to use local time (default, CTime::eLocal) or Universal Coordinated Time (CTime::eUTC).

Definition at line 1289 of file ncbitime.hpp.

◆ CDeadline() [1/4]

CDeadline::CDeadline ( const CTimeout timeout)

◆ CDeadline() [2/4]

CDeadline::CDeadline ( CTimeout::EType  )
private

◆ CDeadline() [3/4]

CDeadline::CDeadline ( EType  type = eNoWait)

Initialize deadline of specified type.

Definition at line 3761 of file ncbitime.cpp.

◆ CDeadline() [4/4]

CDeadline::CDeadline ( unsigned int  rel_seconds,
unsigned int  rel_nanoseconds = 0 
)

Initialize deadline using seconds and nanoseconds (adding to the current time)

Parameters
secondsNumber of seconds to add to the current time
nanosecondsNumber of nanoseconds to add to the current time

Definition at line 3767 of file ncbitime.cpp.

References CDeadline::x_SetNowPlus().

◆ CFastLocalTime()

CFastLocalTime::CFastLocalTime ( unsigned int  sec_after_hour = 5)

Constructor.

It should not try to get local time from OS more often than once an hour. Default: check once, 5 seconds after each hour.

Definition at line 3925 of file ncbitime.cpp.

References Daylight, CTime::eHour, int, CFastLocalTime::m_Daylight, CFastLocalTime::m_LocalTime, CFastLocalTime::m_Timezone, CFastLocalTime::m_TunedTime, CGuard< Resource, Lock, Unlock, ReportExceptions >::Release(), CTime::SetTimeZonePrecision(), and TimeZone.

◆ Clear() [1/2]

CTime & CTime::Clear ( void  )

◆ Clear() [2/2]

CTimeSpan & CTimeSpan::Clear ( void  )
inline

Make the time span "empty",.

Definition at line 2522 of file ncbitime.hpp.

References CTimeSpan::m_NanoSec, and CTimeSpan::m_Sec.

Referenced by CTimeSpan::AssignFromSmartString(), CTimeSpan::CTimeSpan(), CRetryContext::ResetDelay(), and CTimeSpan::x_Init().

◆ CNanoTimeout()

CNanoTimeout::CNanoTimeout ( unsigned int  seconds,
unsigned int  nanoseconds 
)
inline

Definition at line 1812 of file ncbitime.hpp.

References CTimeout::SetNano().

◆ CStopWatch() [1/2]

CStopWatch::CStopWatch ( bool  start)

Constructor.

Start timer if argument is true.

Deprecated:
Use CStopWatch(EStat) constructor instead.
Deprecated:

Definition at line 4084 of file ncbitime.cpp.

References CStopWatch::eStop, CStopWatch::m_Start, CStopWatch::m_State, CStopWatch::m_Total, and CStopWatch::Start().

◆ CStopWatch() [2/2]

CStopWatch::CStopWatch ( EStart  state = eStop)
inline

Constructor.

NB. By default ctor doesn't start timer, it merely creates it.

Definition at line 2753 of file ncbitime.hpp.

References CStopWatch::eStart, CStopWatch::eStop, CStopWatch::m_Start, CStopWatch::m_State, CStopWatch::m_Total, and CStopWatch::Start().

◆ CTime() [1/7]

CTime::CTime ( const CTime t)

Copy constructor.

Definition at line 430 of file ncbitime.cpp.

References t.

◆ CTime() [2/7]

CTime::CTime ( const string str,
const CTimeFormat fmt = kEmptyStr,
ETimeZone  tz = eLocal,
ETimeZonePrecision  tzp = eTZPrecisionDefault 
)
explicit

Explicit conversion constructor for string representation of time.

Construct time object from string representation of time.

Parameters
strString representation of time in format "fmt".
fmtFormat in which "str" is presented. Default value of kEmptyStr, implies the format, that was previously setup using SetFormat() method, or default "M/D/Y h:m:s".
tzIf current format contains 'Z', then objects timezone will be set to:
  • eUTC if "str" has words "GMT", "UTC" or "Z" (zero UTC offset) in the appropriate position;
  • eLocal otherwise. If current format does not contain 'Z', objects timezone will be set to 'tz' value.
See also
AsString, operator=

Definition at line 1014 of file ncbitime.cpp.

References _ASSERT, CTime::eGmt, CTime::eLocal, CTime::eUTC, CTime::GetFormat(), CTimeFormat::IsEmpty(), CTime::m_Data, str(), CTime::TData::tz, CTime::TData::tzprec, and CTime::x_Init().

◆ CTime() [3/7]

CTime::CTime ( const struct tm &  t,
ETimeZonePrecision  tzp = eTZPrecisionDefault 
)

Conversion constructor for "struct tm" local time representation.

Construct time object from "struct tm" time value. The constructed object will be in the eLocal format.

Parameters
tTime in "struct tm" format.
tzpWhat time zone precision to use.
See also
SetTimeTM, GetTimeTM

Definition at line 1005 of file ncbitime.cpp.

References CTime::eLocal, CTime::m_Data, CTime::SetTimeTM(), t, CTime::TData::tz, and CTime::TData::tzprec.

◆ CTime() [4/7]

CTime::CTime ( EInitMode  mode = eEmpty,
ETimeZone  tz = eLocal,
ETimeZonePrecision  tzp = eTZPrecisionDefault 
)

Constructor.

Parameters
modeWhether to build time object with current time or empty time (default).
tzWhether to use local time (default) or UTC.
tzpWhat time zone precision to use.

Definition at line 985 of file ncbitime.cpp.

References CTime::eCurrent, CTime::m_Data, CTime::SetCurrent(), CTime::TData::tz, and CTime::TData::tzprec.

Referenced by CTime::AddDay(), CTime::AddMinute(), CTime::AddMonth(), CTime::AsString(), CTime::CTime(), CTime::GetTimeDBI(), CTime::GetTimeDBU(), CTime::x_AddHour(), and CTime::YearDayNumber().

◆ CTime() [5/7]

CTime::CTime ( int  year,
int  month,
int  day,
int  hour = 0,
int  minute = 0,
int  second = 0,
long  nanosecond = 0,
ETimeZone  tz = eLocal,
ETimeZonePrecision  tzp = eTZPrecisionDefault 
)

Constructor.

Construct time given the year, month, day, hour, minute, second, nanosecond parts of a time value.

Parameters
yearYear part of time.
monthMonth part of time. Note month starts from 1.
dayDay part of time. Note day starts from 1.
hourHour part of time.
minuteMinute part of time.
secondSecond part of time.
nanosecondNanosecond part of time.
tzWhether to use local time (default) or UTC.
tzpWhat time zone precision to use.

Definition at line 952 of file ncbitime.cpp.

References CTime::TData::adjTimeDiff, CHECK_RANGE_DAY, CHECK_RANGE_HOUR, CHECK_RANGE_MIN, CHECK_RANGE_MONTH, CHECK_RANGE_NSEC, CHECK_RANGE_SEC, CHECK_RANGE_YEAR, CTime::IsValid(), CTime::m_Data, CTime::TData::nanosec, NCBI_THROW, s_TimeDump(), SET_DAY, SET_HOUR, SET_MIN, SET_MONTH, SET_SEC, SET_YEAR, CTime::TData::tz, and CTime::TData::tzprec.

◆ CTime() [6/7]

CTime::CTime ( int  year,
int  yearDayNumber,
ETimeZone  tz = eLocal,
ETimeZonePrecision  tzp = eTZPrecisionDefault 
)

Constructor.

Construct date as N-th day of the year.

Parameters
yearYear part of date.
yearDayNumberN-th day of the year.
tzWhether to use local time (default) or UTC.
tzpWhat time zone precision to use.

Definition at line 436 of file ncbitime.cpp.

References CTime::CTime(), CTime::TData::day, CTime::m_Data, CTime::TData::month, t, CTime::TData::tz, CTime::TData::tzprec, and CTime::TData::year.

◆ CTime() [7/7]

CTime::CTime ( time_t  t,
ETimeZonePrecision  tzp = eTZPrecisionDefault 
)
explicit

Conversion constructor for time_t representation of time.

Construct time object from UTC time_t value. The constructed object will be in the eUTC format.

Parameters
tTime in the UTC time_t format.
tzpWhat time zone precision to use.
See also
SetTimeT, GetTimeT

Definition at line 996 of file ncbitime.cpp.

References CTime::eUTC, CTime::m_Data, CTime::SetTimeT(), t, CTime::TData::tz, and CTime::TData::tzprec.

◆ CTimeFormat() [1/4]

CTimeFormat::CTimeFormat ( const char *  fmt,
TFlags  flags = fDefault 
)

Constructor.

See also
SetFormat

Definition at line 340 of file ncbitime.cpp.

References flags, and CTimeFormat::SetFormat().

◆ CTimeFormat() [2/4]

CTimeFormat::CTimeFormat ( const CTimeFormat fmt)

Copy constructor.

Definition at line 334 of file ncbitime.cpp.

◆ CTimeFormat() [3/4]

CTimeFormat::CTimeFormat ( const string fmt,
TFlags  flags = fDefault 
)

Constructor.

See also
SetFormat

Definition at line 346 of file ncbitime.cpp.

References flags, and CTimeFormat::SetFormat().

◆ CTimeFormat() [4/4]

CTimeFormat::CTimeFormat ( void  )

Default constructor.

Definition at line 327 of file ncbitime.cpp.

Referenced by CTimeFormat::GetPredefined().

◆ CTimeout() [1/5]

CTimeout::CTimeout ( const CTimeSpan ts)
inline

Initialize timeout from CTimeSpan.

Definition at line 2714 of file ncbitime.hpp.

References CTimeout::Set().

◆ CTimeout() [2/5]

CTimeout::CTimeout ( double  sec)
inlineexplicit

Initialize timeout from number of seconds (fractional value).

Definition at line 2720 of file ncbitime.hpp.

References CTimeout::Set().

◆ CTimeout() [3/5]

CTimeout::CTimeout ( EType  type)
inline

Create timeout of specified type.

Definition at line 2711 of file ncbitime.hpp.

References CTimeout::Set().

◆ CTimeout() [4/5]

CTimeout::CTimeout ( unsigned int  sec,
unsigned int  usec 
)
inline

Initialize timeout in seconds and microseconds.

Note
Use CNanoTimeout ctor to initialize with (seconds and) nanoseconds
See also
CNanoTimeout

Definition at line 2717 of file ncbitime.hpp.

References CTimeout::Set().

◆ CTimeout() [5/5]

CTimeout::CTimeout ( void  )
inline

Create default timeout.

Definition at line 2708 of file ncbitime.hpp.

References CTimeout::eDefault, and CTimeout::Set().

◆ CTimeSpan() [1/6]

CTimeSpan::CTimeSpan ( const CTimeSpan t)
inline

Copy constructor.

Definition at line 2515 of file ncbitime.hpp.

References CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, and t.

◆ CTimeSpan() [2/6]

CTimeSpan::CTimeSpan ( const string str,
const CTimeFormat fmt = kEmptyStr 
)
explicit

Explicit conversion constructor for string representation of time span.

Construct time span object from string representation of time.

Parameters
strString representation of time span in format "fmt".
fmtFormat in which "str" is presented. Default value of kEmptyStr, implies the format set with SetFormat(), or "-G" if SetFormat() has not used before.
See also
SetFormat

Definition at line 2447 of file ncbitime.cpp.

References CTimeFormat::IsEmpty(), kDefaultFormatSpanIn, s_TlsFormatSpan, str(), and CTimeSpan::x_Init().

◆ CTimeSpan() [3/6]

CTimeSpan::CTimeSpan ( double  seconds)
inlineexplicit

Constructor.

Construct time span from number of seconds. Please, use this constructor as rarely as possible, because after doing some arithmetical operations and conversion with it, the time span can differ at some nanoseconds from expected value.

Parameters
secondsSecond part of time. The fractional part is used to compute nanoseconds.

Definition at line 2509 of file ncbitime.hpp.

References CTimeSpan::Set().

◆ CTimeSpan() [4/6]

CTimeSpan::CTimeSpan ( long  days,
long  hours,
long  minutes,
long  seconds,
long  nanoseconds = 0 
)

Constructor.

Construct time span given the number of days, hours, minutes, seconds, nanoseconds parts of a time span value.

Parameters
daysDay part of time. Note day starts from 1.
hoursHour part of time.
minutesMinute part of time.
secondsSecond part of time.
nanosecondsNanosecond part of time.

Definition at line 2427 of file ncbitime.cpp.

References NStr::Int8ToString(), kNanoSecondsPerSecond, CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, NCBI_THROW, and CTimeSpan::x_Normalize().

◆ CTimeSpan() [5/6]

CTimeSpan::CTimeSpan ( long  seconds,
long  nanoseconds = 0 
)
inlineexplicit

Constructor.

Construct time span given the number of seconds and nanoseconds.

Parameters
secondsSecond part of time.
nanosecondsNanosecond part of time.

Definition at line 2503 of file ncbitime.hpp.

References CTimeSpan::Set().

◆ CTimeSpan() [6/6]

CTimeSpan::CTimeSpan ( void  )
inline

◆ CurrentTime()

◆ Day()

int CTime::Day ( void  ) const
inline

◆ DayOfWeek()

int CTime::DayOfWeek ( void  ) const

Get day of week.

Days since Sunday = 0..6 AsString() format symbols "W", "w".

Definition at line 1186 of file ncbitime.cpp.

References CTime::Day(), int, CTime::IsEmptyDate(), CTime::Month(), NCBI_THROW, and CTime::Year().

Referenced by CCgiCookie::SetExpTime(), CTime::x_Init(), and CTime::YearWeekNumber().

◆ DayOfWeekNameToNum()

int CTime::DayOfWeekNameToNum ( const string day)
static

Get numerical value of the day of week by name.

Parameters
dayFull or abbreviated day of week name.
Returns
Numerical value of a given day of week (0..6).
See also
DayOfWeekNumToName, DayOfWeek

Definition at line 1241 of file ncbitime.cpp.

References NStr::CompareNocase(), i, kWeekdayAbbr, kWeekdayFull, and NCBI_THROW.

◆ DayOfWeekNumToName()

string CTime::DayOfWeekNumToName ( int  day,
ENameFormat  format = eFull 
)
static

Get name of the day of week by numerical value.

Parameters
dayFull or abbreviated day of week name.
formatFormat for returned value (full or abbreviated).
Returns
Name of the day of week.
See also
DayOfWeekNameToNum, DayOfWeek

Definition at line 1259 of file ncbitime.cpp.

References CTime::eFull, kEmptyStr, kWeekdayAbbr, and kWeekdayFull.

◆ DaysInMonth()

int CTime::DaysInMonth ( void  ) const

Get number of days in the month.

Number of days = 28..31

Definition at line 1199 of file ncbitime.cpp.

References CTime::IsEmptyDate(), CTime::IsLeap(), CTime::Month(), NCBI_THROW, and s_DaysInMonth.

Referenced by CSubSource::IsDayValueOkForMonth(), CTime::SetDay(), CTime::SetMonth(), CTime::SetYear(), and CTime::x_AdjustDay().

◆ DiffDay()

double CTime::DiffDay ( const CTime t) const
inline

Difference in days from specified time.

Definition at line 2393 of file ncbitime.hpp.

References CTime::DiffSecond(), and t.

◆ DiffHour()

double CTime::DiffHour ( const CTime t) const
inline

Difference in hours from specified time.

Definition at line 2399 of file ncbitime.hpp.

References CTime::DiffSecond(), and t.

◆ DiffMinute()

double CTime::DiffMinute ( const CTime t) const
inline

Difference in minutes from specified time.

Definition at line 2405 of file ncbitime.hpp.

References CTime::DiffSecond(), and t.

◆ DiffNanoSecond()

double CTime::DiffNanoSecond ( const CTime t) const
inline

Difference in nanoseconds from specified time.

Definition at line 2411 of file ncbitime.hpp.

References CTime::DiffSecond(), kNanoSecondsPerSecond, CTime::NanoSecond(), and t.

Referenced by CSparseGraph::Init(), CReader::WaitBeforeNewConnection(), and CReader::x_AllocConnection().

◆ DiffSecond()

TSeconds CTime::DiffSecond ( const CTime t) const

◆ DiffTimeSpan()

CTimeSpan CTime::DiffTimeSpan ( const CTime t) const

◆ DiffWholeDays()

int CTime::DiffWholeDays ( const CTime t) const

Difference in whole days from specified time.

Definition at line 2277 of file ncbitime.cpp.

References int, s_Date2Number(), and t.

Referenced by CTime::DiffSecond(), and CTime::TimeZoneOffset().

◆ Elapsed()

double CStopWatch::Elapsed ( void  ) const
inline

Return time elapsed since first Start() or last Restart() call (in seconds).

Result is 0.0 if Start() or Restart() wasn't previously called.

Definition at line 2775 of file ncbitime.hpp.

References CStopWatch::eStop, CStopWatch::GetTimeMark(), CStopWatch::m_Start, CStopWatch::m_State, and CStopWatch::m_Total.

Referenced by CBuildDatabase::AddSequences(), CThreadPool_Impl::AddTask(), CNcbiTestApplication::AdjustTestTimeout(), CStopWatch::AsSmartString(), CStopWatch::AsString(), BOOST_AUTO_TEST_CASE(), IPhyloTreeRender::BufferedRender(), CBuildDatabase::Build(), CPhyloTreePS::CalcForces(), CBamFileInfo::CBamFileInfo(), CGlWidgetPane::CheckOverlayTimer(), CompressAssembly(), ConvertToPairwise(), CBDB_Cache::EvaluateTimeLine(), CExecute::Exec(), CChangePhyloTreeCommand::Execute(), CChangePhyloPropertyCmd::Execute(), CChangePhyloExpandCollapseCmd::Execute(), CQueryParsePanel::CQueryJob::Execute(), CMacroWorker::ExecuteMacros(), CSeqEntryPresenter::Finalize(), CFlatFileGenerator::Generate(), GetBlobReader(), CSNPDataLoader_Impl::GetChunkOnce(), CReaderRequestResultRecursion::GetCurrentRequestTime(), CPerfLogger::GetElapsedTime(), CSNPFileInfo::InitializeDb(), CProcess::Kill(), IPhyloTreeRender::Layout(), CBamRefSeqInfo::LoadAlignChunk(), CSNPDataLoader_Impl::LoadBlob(), CBamRefSeqInfo::LoadMainSplit(), CBamRefSeqInfo::LoadPileupChunk(), CBamRefSeqInfo::LoadSeqChunk(), CBDB_SplitTest::LoadSplitStore(), CBDB_SplitTest::LoadTestSet(), CPhyTreeView::OnBioTreeChanged(), CProjectTreePanel::OnDragOver(), CThreadPool_Controller_PID::OnEvent(), CUpdateMultiSeq_Dlg::OnIdle(), CPhyTreeView::OnSomethingEdited(), CNetBLASTUIDataSource::Open(), CGenBankUIDataSource::Open(), CSQLITE3_Cache::Open(), CAlignSort::SAlignExtractor::operator()(), CQueryExecEvalFunc::operator()(), CFileHandleDiagHandler::Post(), CFileDiagHandler::Post(), CPerfLogger::Post(), CSeqEntryPresenter::Process(), CBam2GraphApp::ProcessFile(), CBlastMasterNode::Processing(), CGlCgiImageApplication::ProcessRequest(), CBamIndex::Read(), CBiosampleChkApp::ReadClassMember(), CAsnvalThreadState::ReadClassMember(), CTreeGraphicsModel::Render(), IPhyloTreeRender::Render(), CFileHandleDiagHandler::Reopen(), CFileDiagHandler::Reopen(), CSeqDescrRetrievalJob::Run(), CAnnotMetaDataJob::Run(), CAsnCacheTestApplication::Run(), CCacheIndexCopyApp::Run(), CAsnSubCacheCreateApplication::Run(), CWalkAsnCacheApplication::Run(), CDemoApp::Run(), CMytestApplication::Run(), CProjBulderApp::Run(), CObjConvProfile::Run(), CSampleNetScheduleClient::Run(), CConvImageApp::Run(), CSubImageApp::Run(), CDbapiTestSpeedApp::RunSample(), s_GetDBTree(), s_Win_KillGroup(), CSparseGraph::Save(), CGBenchService::SendAppFinish(), CCachedTaxon3_impl::SendOrgRefList(), UncomressAndCreate(), CPhyloTreePS::Update(), CAsnvalThreadState::ValidateTraditionally(), CAsnvalThreadState::ValidateWorker(), CThread::WaitForAllThreads(), CTimeReporter::Write(), CAsnSubCacheCreateApplication::WriteBlobsInSubCache(), CFileHandleDiagHandler::WriteMessage(), CFileDiagHandler::WriteMessage(), CBuildDatabase::x_AddRemoteSequences(), CBamRefSeqInfo::x_AddSeqChunk(), CRequestRateControl::x_Approve(), CForceJob::x_Calculate(), CImportFeatTable::x_CreateCommand(), CAlnMultiDSBuilder::x_CreateSparseDataSource(), CComponentSearchJob::x_DoSearch(), CBuildDatabase::x_DupLocal(), CWorkerNodeIdleThread::x_GetIdleTimeIfShutdown(), CWorkerNodeIdleThread::x_GetInterval(), CRemoteBlast::x_GetRequestInfoFromRID(), CRemoteBlast::x_GetSubjects(), CCSRARefSeqInfo::x_LoadRangesStat(), CSyncQueue< Type, Container, Traits >::x_LockAndWait(), CWorkspaceAutoSaver::x_OnSave(), CReadIndexSpeedApp::x_PreReadIndex(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CId2FetchApp::x_ProcessRequest(), CBGZFFile::x_ReadBlock(), CPagedFile::x_ReadPage(), CPhyloTreePane::x_Render(), IPhyloTreeRender::x_RenderTooltipHints(), CAnnot_Collector::x_SearchMapped(), CRemoteBlast::x_SendRequest(), IPhyloTreeRender::x_SetElementVisibility(), CAlignTabExportPage2::x_StartNAAlignNamesJob(), CThreadPool_Impl::x_WaitForPredicate(), CReadIndexSpeedApp::x_WalkIndex(), CEditObjectFeaturePropagate::xGetEditCommandAllSequences(), BlastdbCopyApplication::~BlastdbCopyApplication(), CBlastDBAliasApp::~CBlastDBAliasApp(), CBlastDbCheckApplication::~CBlastDbCheckApplication(), CBlastDBCmdApp::~CBlastDBCmdApp(), CBlastdbConvertApp::~CBlastdbConvertApp(), CBlastFormatterApp::~CBlastFormatterApp(), CBlastFormatterVdbApp::~CBlastFormatterVdbApp(), CBlastnApp::~CBlastnApp(), CBlastpApp::~CBlastpApp(), CBlastVdbCmdApp::~CBlastVdbCmdApp(), CBlastxApp::~CBlastxApp(), CConvert2BlastMaskApplication::~CConvert2BlastMaskApplication(), CDeltaBlastApp::~CDeltaBlastApp(), CMagicBlastApp::~CMagicBlastApp(), CMakeBlastDBApp::~CMakeBlastDBApp(), CMakeClusterDBApp::~CMakeClusterDBApp(), CMakeProfileDBApp::~CMakeProfileDBApp(), CMultiApplication::~CMultiApplication(), CPsiBlastApp::~CPsiBlastApp(), CRPSBlastApp::~CRPSBlastApp(), CRPSTBlastnApp::~CRPSTBlastnApp(), CTblastnApp::~CTblastnApp(), CTblastxApp::~CTblastxApp(), CVDBBlastnApp::~CVDBBlastnApp(), CVDBTblastnApp::~CVDBTblastnApp(), and SW::~SW().

◆ Get()

void CTimeout::Get ( unsigned int sec,
unsigned int microsec 
) const

◆ GetAsDouble() [1/2]

double CTimeSpan::GetAsDouble ( void  ) const
inline

Return time span as number of seconds.

Returns
Return representative of time span as type double. The fractional part represents nanoseconds part of time span. The double representation of the time span is aproximate.

Definition at line 2565 of file ncbitime.hpp.

References kNanoSecondsPerSecond, CTimeSpan::m_NanoSec, and CTimeSpan::m_Sec.

Referenced by CThreadPool_Impl::AddTask(), CPerfLogger::Adjust(), CNSTDatabase::ExecSP_SetExpiration(), CRequestRateControl::Reset(), s_ProgressCallback(), s_TimerCallback(), CPerfLogger::Suspend(), CRPCClient_Base::x_Ask(), CNSTServiceProperties::x_GetProlongInTTLs(), CRPCClient_Base::x_GetRetryDelay(), and CThreadPool_Impl::x_WaitForPredicate().

◆ GetAsDouble() [2/2]

double CTimeout::GetAsDouble ( void  ) const

◆ GetAsMilliSeconds()

unsigned long CTimeout::GetAsMilliSeconds ( void  ) const

◆ GetAsTimeSpan()

CTimeSpan CTimeout::GetAsTimeSpan ( void  ) const

◆ GetCompleteDays()

long CTimeSpan::GetCompleteDays ( void  ) const
inline

Get number of complete days.

Definition at line 2550 of file ncbitime.hpp.

References CTimeSpan::m_Sec.

Referenced by CTimeSpan::AsString().

◆ GetCompleteHours()

long CTimeSpan::GetCompleteHours ( void  ) const
inline

Get number of complete hours.

Definition at line 2553 of file ncbitime.hpp.

References CTimeSpan::m_Sec.

Referenced by CTimeSpan::AsString().

◆ GetCompleteMinutes()

long CTimeSpan::GetCompleteMinutes ( void  ) const
inline

Get number of complete minutes.

Definition at line 2556 of file ncbitime.hpp.

References CTimeSpan::m_Sec.

Referenced by CTimeSpan::AsString().

◆ GetCompleteSeconds()

long CTimeSpan::GetCompleteSeconds ( void  ) const
inline

◆ GetCurrentTimeT()

void CTime::GetCurrentTimeT ( time_t *  sec,
long *  nanosec = 0 
)
static

Get current UTC time in time_t format (with nanoseconds).

Parameters
secThe function return the number of seconds elapsed since midnight (00:00:00), January 1, 1970 UTC.
nanosecNumber of nanoseconds (0, if not possible to get).
Attention
Result can differs from time(NULL) due different implementation and taking into account nanosecond part on some platforms (rounding).

Definition at line 1672 of file ncbitime.cpp.

References _ASSERT, kMicroSecondsPerSecond, kNanoSecondsPerSecond, NCBI_CONST_UINT8, and NCBI_THROW.

Referenced by CFastLocalTime::GetLocalTime(), CFastLocalTime::GetLocalTimezone(), CMacroStat::LogStart(), CMacroStat::LogStop(), CNcbiApplogApp::Redirect(), CNcbiApplogApp::SetInfo(), CFastLocalTime::Tuneup(), CNcbiEncrypt::x_AddSalt(), CTar::x_Append(), CCDDClientPool::x_GetClient(), CCDDClientPool::x_ReleaseClient(), and CTime::x_SetTime().

◆ GetErrCodeString()

const char * CTimeException::GetErrCodeString ( void  ) const
overridevirtual

Translate from the error code value to its string representation.

Reimplemented from CCoreException.

Definition at line 4178 of file ncbitime.cpp.

References CTimeException::eArgument, CTimeException::eConvert, CTimeException::eFormat, CTimeException::eInvalid, CCoreException::GetErrCode(), and CException::GetErrCodeString().

◆ GetExpirationTime()

void CDeadline::GetExpirationTime ( time_t *  sec,
unsigned int nanosec 
) const

Get the number of seconds and nanoseconds (since 1/1/1970).

Throw an exception if the deadline is infinite.

Definition at line 3842 of file ncbitime.cpp.

References CTimeout::eInfinite, CDeadline::IsInfinite(), CDeadline::m_Nanoseconds, CDeadline::m_Seconds, NCBI_THROW, and s_SpecialValueName().

Referenced by CConnTest::ExtraCheckOnFailure(), CRWLock::TryReadLock(), CRWLock::TryWriteLock(), SPSG_CV< deque< string > >::x_GetTP(), and CConditionVariable::x_WaitForSignal().

◆ GetFastLocalTime()

CTime GetFastLocalTime ( void  )

◆ GetFlags()

CTimeFormat::TFlags CTimeFormat::GetFlags ( void  ) const
inline

Get format flags.

Returns
A flags specifying how to match a time string against format string.
See also
SetFormat, GetString

Definition at line 2242 of file ncbitime.hpp.

References CTimeFormat::m_Flags.

◆ GetFormat() [1/3]

CTimeFormat CTime::GetFormat ( void  )
static

Get the current time format.

The default format is: "M/D/Y h:m:s".

Returns
An object describing the time format.
See also
CTimeFormat, SetFormat, AsString

Definition at line 1277 of file ncbitime.cpp.

References kDefaultFormatTime, s_TlsFormatTime, and CTimeFormat::SetFormat().

Referenced by CTime::AsString(), CTime::CTime(), CTime::operator=(), and CTime::ValidateString().

◆ GetFormat() [2/3]

CTimeFormat CTimeSpan::GetFormat ( void  )
static

Get the current time span format.

If SetFormat() has not used before, that default formats are: "-S.n" - to output with AsString(); "-G" - to initialize from string.

Returns
An object describing the time format.
See also
CTimeFormat, SetFormat, AsString

Definition at line 2668 of file ncbitime.cpp.

References kDefaultFormatSpan, s_TlsFormatSpan, and CTimeFormat::SetFormat().

Referenced by CTimeSpan::AsString().

◆ GetFormat() [3/3]

CTimeFormat CStopWatch::GetFormat ( void  )
static

Get the current stopwatch time format.

The default format is: "S.n".

Returns
An object describing the time format. The letters having the same means that for CTimeSpan.
See also
CTimeFormat, CTimeSpan::GetFormat, AsString

Definition at line 4136 of file ncbitime.cpp.

References kDefaultFormatStopWatch, s_TlsFormatStopWatch, and CTimeFormat::SetFormat().

Referenced by CStopWatch::AsString().

◆ GetGmtTime()

CTime CTime::GetGmtTime ( void  ) const
inline

Definition at line 1156 of file ncbitime.hpp.

References CTime::GetUniversalTime().

Referenced by s_FileTimeToCTime(), and CCgiResponse::SetHeaderValue().

◆ GetLocalTime() [1/2]

CTime CFastLocalTime::GetLocalTime ( void  )

◆ GetLocalTime() [2/2]

CTime CTime::GetLocalTime ( void  ) const

◆ GetLocalTimezone()

int CFastLocalTime::GetLocalTimezone ( void  )

◆ GetNano()

void CTimeout::GetNano ( unsigned int sec,
unsigned int nanosec 
) const

◆ GetNanoSecondsAfterSecond()

long CTimeSpan::GetNanoSecondsAfterSecond ( void  ) const
inline

◆ GetPredefined()

CTimeFormat CTimeFormat::GetPredefined ( EPredefined  fmt,
TFlags  flags = fDefault 
)
static

◆ GetRemainingTime()

CNanoTimeout CDeadline::GetRemainingTime ( void  ) const

◆ GetSign()

ESign CTimeSpan::GetSign ( void  ) const
inline

◆ GetString()

const string & CTimeFormat::GetString ( void  ) const
inline

Get format string.

Returns
A string of symbols describing the time format.
See also
SetFormat, GetFlags

Definition at line 2236 of file ncbitime.hpp.

References CTimeFormat::m_Str.

Referenced by CRR_Field< TTraits >::Get().

◆ GetTimeDBI()

TDBTimeI CTime::GetTimeDBI ( void  ) const

Get time in database format time, TDBTimeI.

Returns
Time value in database format TDBTimeI.

Definition at line 1467 of file ncbitime.cpp.

References CTime::CTime(), TDBTimeI::days, first(), CTime::GetLocalTime(), kNanoSecondsPerSecond, s_Date2Number(), t, and TDBTimeI::time.

Referenced by CDB_DateTime::Get300Secs(), and CDB_DateTime::GetDays().

◆ GetTimeDBU()

TDBTimeU CTime::GetTimeDBU ( void  ) const

Get time in database format time, TDBTimeU.

Returns
Time value in database format, TDBTimeU.

Definition at line 1454 of file ncbitime.cpp.

References CTime::CTime(), TDBTimeU::days, first(), CTime::GetLocalTime(), s_Date2Number(), t, and TDBTimeU::time.

Referenced by CDB_SmallDateTime::GetDays(), and CDB_SmallDateTime::GetMinutes().

◆ GetTimeMark()

double CStopWatch::GetTimeMark ( )
staticprotected

Get current time mark.

Definition at line 4095 of file ncbitime.cpp.

References first().

Referenced by CStopWatch::Elapsed(), CStopWatch::Restart(), CStopWatch::Start(), and CStopWatch::Stop().

◆ GetTimeT()

time_t CTime::GetTimeT ( void  ) const

◆ GetTimeTM()

struct tm CTime::GetTimeTM ( void  ) const

Get time in "struct tm" format.

Returns
Time in "struct tm" format (local time).

Definition at line 1396 of file ncbitime.cpp.

References CTime::IsEmptyDate(), NCBI_THROW, and s_GetTimeT().

◆ GetTimeZone()

CTime::ETimeZone CTime::GetTimeZone ( void  ) const
inline

◆ GetTimeZoneFormat()

CTime::ETimeZone CTime::GetTimeZoneFormat ( void  ) const
inline

Definition at line 2430 of file ncbitime.hpp.

References CTime::GetTimeZone().

◆ GetTimeZonePrecision()

CTime::ETimeZonePrecision CTime::GetTimeZonePrecision ( void  ) const
inline

◆ GetUniversalTime()

CTime CTime::GetUniversalTime ( void  ) const

Get the time as universal (GMT/UTC) time.

Definition at line 2061 of file ncbitime.cpp.

References CTime::IsEmptyDate(), CTime::IsUniversalTime(), NCBI_THROW, and t.

Referenced by CTime::GetGmtTime(), and CTime::TimeZoneOffset().

◆ Hour()

int CTime::Hour ( void  ) const
inline

◆ Invert()

void CTimeSpan::Invert ( void  )
inline

Invert time span. Changes time span sign.

Definition at line 2637 of file ncbitime.hpp.

References CTimeSpan::m_NanoSec, and CTimeSpan::m_Sec.

Referenced by CTimeSpan::x_Init().

◆ IsDefault()

bool CTimeout::IsDefault ( ) const
inline

◆ IsDST()

bool CTime::IsDST ( void  ) const

Is DST (daylight savings time) in effect for this time?

Note
This method use current DST rules on current machine, so be aware to use it against time in the past or future, because such rules can be changed.

Definition at line 1385 of file ncbitime.cpp.

References CTime::IsEmptyDate(), NCBI_THROW, and s_IsDST().

◆ IsEmpty() [1/3]

bool CTimeFormat::IsEmpty ( void  ) const
inline

Check that format string is empty.

Definition at line 2248 of file ncbitime.hpp.

References CTimeFormat::m_Str.

Referenced by CStopWatch::AsString(), CTime::CTime(), CTimeSpan::CTimeSpan(), and CTime::ValidateString().

◆ IsEmpty() [2/3]

bool CTime::IsEmpty ( void  ) const
inline

◆ IsEmpty() [3/3]

bool CTimeSpan::IsEmpty ( void  ) const
inline

◆ IsEmptyDate()

bool CTime::IsEmptyDate ( void  ) const
inline

◆ IsExpired()

bool CDeadline::IsExpired ( void  ) const
inline

◆ IsFinite()

bool CTimeout::IsFinite ( ) const
inline

◆ IsGmtTime()

bool CTime::IsGmtTime ( void  ) const
inline

Definition at line 1108 of file ncbitime.hpp.

References CTime::IsUniversalTime().

Referenced by CCgiCookie::SetExpTime().

◆ IsInfinite() [1/2]

bool CTimeout::IsInfinite ( void  ) const
inline

◆ IsInfinite() [2/2]

bool CDeadline::IsInfinite ( void  ) const
inline

◆ IsLeap()

bool CTime::IsLeap ( void  ) const

Is time in a leap year?

Definition at line 2211 of file ncbitime.cpp.

References CTime::Year().

Referenced by CTime::DaysInMonth(), CTime::IsValid(), and CTime::YearDayNumber().

◆ IsLocalTime()

bool CTime::IsLocalTime ( void  ) const
inline

Is time local time?

Definition at line 2418 of file ncbitime.hpp.

References CTime::eLocal, CTime::m_Data, and CTime::TData::tz.

Referenced by CTime::GetLocalTime().

◆ IsRunning()

bool CStopWatch::IsRunning ( void  ) const
inline

◆ IsUniversalTime()

bool CTime::IsUniversalTime ( void  ) const
inline

Is time universal (GMT/UTC/Z)?

Definition at line 2421 of file ncbitime.hpp.

References CTime::eGmt, CTime::m_Data, and CTime::TData::tz.

Referenced by CTime::AsString(), CTimeToTimeTms(), CVDBMgr::GetTimestamp(), CTime::GetUniversalTime(), CTime::IsGmtTime(), and s_TimeDump().

◆ IsValid()

bool CTime::IsValid ( void  ) const

◆ IsZero()

bool CTimeout::IsZero ( void  ) const

◆ MicroSecond()

long CTime::MicroSecond ( void  ) const
inline

Get microseconds.

Microseconds after the second = 0..999999 AsString() format symbol "r".

See also
NanoSecond

Definition at line 2286 of file ncbitime.hpp.

References CTime::m_Data, and CTime::TData::nanosec.

◆ MilliSecond()

long CTime::MilliSecond ( void  ) const
inline

Get milliseconds.

Milliseconds after the second = 0..999 AsString() format symbol "l".

See also
NanoSecond

Definition at line 2283 of file ncbitime.hpp.

References CTime::m_Data, and CTime::TData::nanosec.

Referenced by CTimeToTimeTms().

◆ Minute()

int CTime::Minute ( void  ) const
inline

◆ Month()

int CTime::Month ( void  ) const
inline

◆ MonthNameToNum()

int CTime::MonthNameToNum ( const string month)
static

Get numerical value of the month by name.

Parameters
monthFull or abbreviated month name.
Returns
Numerical value of a given month (1..12).
See also
MonthNumToName, Month

Definition at line 1212 of file ncbitime.cpp.

References NStr::CompareNocase(), i, kMonthAbbr, kMonthFull, and NCBI_THROW.

Referenced by CSubSource::DateFromCollectionDate(), and CSubSource::FixDateFormat().

◆ MonthNumToName()

string CTime::MonthNumToName ( int  month,
ENameFormat  format = eFull 
)
static

Get name of the month by numerical value.

Parameters
monthFull or abbreviated month name.
formatFormat for returned value (full or abbreviated).
Returns
Name of the month.
See also
MonthNameToNum, Month

Definition at line 1230 of file ncbitime.cpp.

References CTime::eFull, NStr::IntToString(), kMonthAbbr, kMonthFull, and NCBI_THROW.

Referenced by CSubSource::FixDateFormat(), s_ChooseMonthAndDay(), and CMacroInterpreter::x_SetPubDateValidateArgs().

◆ MonthWeekNumber()

int CTime::MonthWeekNumber ( EDayOfWeek  first_day_of_week = eSunday) const

Get this date's week number in the month.

Returns
Week number in the month = 1..6.
See also
YearWeekNumber

Definition at line 1177 of file ncbitime.cpp.

References CTime::Month(), CTime::Year(), and CTime::YearWeekNumber().

◆ NanoSecond()

long CTime::NanoSecond ( void  ) const
inline

◆ NCBI_EXCEPTION_DEFAULT()

CTimeException::NCBI_EXCEPTION_DEFAULT ( CTimeException  ,
CCoreException   
)

◆ operator string() [1/4]

CTimeFormat::operator string ( void  ) const
inline

Return time format as string.

Note: This method added temporarily, and will be deleted soon.

Deprecated:
Use CTimeFormat::GetString()/GetFormat() methods instead.

Definition at line 2254 of file ncbitime.hpp.

◆ operator string() [2/4]

CTime::operator string ( void  ) const
inline

Return time as string using the format returned by GetFormat().

Definition at line 2332 of file ncbitime.hpp.

◆ operator string() [3/4]

CTimeSpan::operator string ( void  ) const
inline

Return span time as string using the format returned by GetFormat().

Definition at line 2593 of file ncbitime.hpp.

◆ operator string() [4/4]

CStopWatch::operator string ( void  ) const
inline

Return stopwatch time as string using the format returned by GetFormat().

Definition at line 2842 of file ncbitime.hpp.

◆ operator!=() [1/3]

bool CTime::operator!= ( const CTime t) const
inline

Operator to test in-equality of time.

Definition at line 2353 of file ncbitime.hpp.

References t.

◆ operator!=() [2/3]

bool CTimeout::operator!= ( const CTimeout t) const
inline

Operator to test in-equality of timeouts.

Definition at line 2741 of file ncbitime.hpp.

References t.

◆ operator!=() [3/3]

bool CTimeSpan::operator!= ( const CTimeSpan t) const
inline

Operator to test in-equality of time span.

Definition at line 2650 of file ncbitime.hpp.

References t.

◆ operator+() [1/3]

CTimeSpan CTimeSpan::operator+ ( const CTimeSpan t) const
inline

Definition at line 2605 of file ncbitime.hpp.

References CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, and t.

◆ operator+() [2/3]

CTime CTime::operator+ ( const CTimeSpan ts) const
inline

Definition at line 2310 of file ncbitime.hpp.

References tmp.

◆ operator+() [3/3]

CTime operator+ ( const CTimeSpan ts,
const CTime t 
)
inline

Definition at line 2172 of file ncbitime.hpp.

References t, and tmp.

◆ operator+=() [1/2]

CTimeSpan & CTimeSpan::operator+= ( const CTimeSpan t)
inline

Definition at line 2596 of file ncbitime.hpp.

References CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, t, and CTimeSpan::x_Normalize().

◆ operator+=() [2/2]

CTime & CTime::operator+= ( const CTimeSpan ts)
inline

Definition at line 2304 of file ncbitime.hpp.

References CTime::AddTimeSpan().

◆ operator-() [1/4]

CTimeSpan CTime::operator- ( const CTime t) const
inline

Operator to subtract times.

Definition at line 2326 of file ncbitime.hpp.

References CTime::DiffTimeSpan(), and t.

◆ operator-() [2/4]

CTimeSpan CTimeSpan::operator- ( const CTimeSpan t) const
inline

Operator to subtract time span.

Definition at line 2621 of file ncbitime.hpp.

References CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, and t.

◆ operator-() [3/4]

CTime CTime::operator- ( const CTimeSpan ts) const
inline

Operator to subtract time span.

Definition at line 2318 of file ncbitime.hpp.

References tmp.

◆ operator-() [4/4]

CTimeSpan CTimeSpan::operator- ( void  ) const
inline

Unary operator "-" (minus) to change time span sign.

Definition at line 2628 of file ncbitime.hpp.

References CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, and t.

◆ operator-=() [1/2]

CTimeSpan & CTimeSpan::operator-= ( const CTimeSpan t)
inline

Operator to subtract time span.

Definition at line 2612 of file ncbitime.hpp.

References CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, t, and CTimeSpan::x_Normalize().

◆ operator-=() [2/2]

CTime & CTime::operator-= ( const CTimeSpan ts)
inline

Operator to subtract time span.

Definition at line 2307 of file ncbitime.hpp.

References CTime::AddTimeSpan().

◆ operator<() [1/4]

bool CDeadline::operator< ( const CDeadline right_hand_operand) const

◆ operator<() [2/4]

bool CTime::operator< ( const CTime t) const

Operator to test if time is earlier.

Definition at line 2174 of file ncbitime.cpp.

References CTime::Day(), CTime::GetTimeZone(), CTime::Hour(), CTime::Minute(), CTime::Month(), CTime::NanoSecond(), CTime::Second(), t, tmp, and CTime::Year().

◆ operator<() [3/4]

bool CTimeout::operator< ( const CTimeout t) const

◆ operator<() [4/4]

bool CTimeSpan::operator< ( const CTimeSpan t) const
inline

Operator to test if time span is less.

Definition at line 2666 of file ncbitime.hpp.

References CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, and t.

◆ operator<<() [1/2]

ostream& operator<< ( ostream &  os,
const CStopWatch sw 
)
inline

Dumps the current stopwatch time to an output stream.

The time will be printed out using format specified by CStopWatch::GetFormat().

Definition at line 2204 of file ncbitime.hpp.

References CStopWatch::AsString(), and sw.

◆ operator<<() [2/2]

ostream& operator<< ( ostream &  os,
const CTime t 
)
inline

Dumps the current CTime time to an output stream.

The time will be printed out using format returned by CTime::GetFormat().

Definition at line 2213 of file ncbitime.hpp.

References t.

◆ operator<=() [1/3]

bool CTime::operator<= ( const CTime t) const
inline

Operator to test if time is earlier or equal.

Definition at line 2365 of file ncbitime.hpp.

References t.

◆ operator<=() [2/3]

bool CTimeout::operator<= ( const CTimeout t) const

◆ operator<=() [3/3]

bool CTimeSpan::operator<= ( const CTimeSpan t) const
inline

Operator to test if time span is less or equal.

Definition at line 2681 of file ncbitime.hpp.

References t.

◆ operator=() [1/5]

CTime & CTime::operator= ( const CTime t)
inline

Assignment operator.

Definition at line 2343 of file ncbitime.hpp.

References CTime::m_Data, and t.

◆ operator=() [2/5]

CTimeFormat & CTimeFormat::operator= ( const CTimeFormat fmt)

Assignment operator.

Definition at line 378 of file ncbitime.cpp.

References CTimeFormat::m_Flags, and CTimeFormat::m_Str.

◆ operator=() [3/5]

CTimeSpan & CTimeSpan::operator= ( const CTimeSpan t)
inline

Assignment operator.

Definition at line 2585 of file ncbitime.hpp.

References CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, and t.

◆ operator=() [4/5]

CTime & CTime::operator= ( const string str)
inline

Assignment operator from string.

If current format contains 'Z', then objects timezone will be set to:

  • eUTC if "str" has words "GMT", "UTC" or "Z" (zero UTC offset) in the appropriate position;
  • eLocal otherwise. If current format does not contain 'Z', objects timezone will not be changed.
    Note
    This operator expect a string in the format, that was previously set using SetFormat() method.
    See also
    CTime constructor from string, AsString

Definition at line 2336 of file ncbitime.hpp.

References CTime::GetFormat(), str(), and CTime::x_Init().

◆ operator=() [5/5]

CTimeSpan & CTimeSpan::operator= ( const string str)

Assignment operator.

Definition at line 2465 of file ncbitime.cpp.

References kDefaultFormatSpanIn, s_TlsFormatSpan, str(), and CTimeSpan::x_Init().

◆ operator==() [1/3]

bool CTime::operator== ( const CTime t) const

Operator to test equality of time.

Definition at line 2120 of file ncbitime.cpp.

References CTime::Day(), CTime::GetTimeZone(), CTime::Hour(), CTime::Minute(), CTime::Month(), CTime::NanoSecond(), CTime::Second(), t, tmp, and CTime::Year().

◆ operator==() [2/3]

bool CTimeout::operator== ( const CTimeout t) const

◆ operator==() [3/3]

bool CTimeSpan::operator== ( const CTimeSpan t) const
inline

Operator to test equality of time span.

Definition at line 2644 of file ncbitime.hpp.

References CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, and t.

◆ operator>() [1/3]

bool CTime::operator> ( const CTime t) const

Operator to test if time is later.

Definition at line 2137 of file ncbitime.cpp.

References CTime::Day(), CTime::GetTimeZone(), CTime::Hour(), CTime::Minute(), CTime::Month(), CTime::NanoSecond(), CTime::Second(), t, tmp, and CTime::Year().

◆ operator>() [2/3]

bool CTimeout::operator> ( const CTimeout t) const

◆ operator>() [3/3]

bool CTimeSpan::operator> ( const CTimeSpan t) const
inline

Operator to test if time span is greater.

Definition at line 2656 of file ncbitime.hpp.

References CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, and t.

◆ operator>=() [1/3]

bool CTime::operator>= ( const CTime t) const
inline

Operator to test if time is later or equal.

Definition at line 2359 of file ncbitime.hpp.

References t.

◆ operator>=() [2/3]

bool CTimeout::operator>= ( const CTimeout t) const

Operator to test if timeout is greater or equal.

Definition at line 3708 of file ncbitime.cpp.

References COMPARE_TIMEOUT_TYPES, CTimeout::eDefault, CTimeout::eFinite, CTimeout::eInfinite, CTimeout::m_NanoSec, CTimeout::m_Sec, CTimeout::m_Type, NCBI_THROW, s_SpecialValueName(), and t.

◆ operator>=() [3/3]

bool CTimeSpan::operator>= ( const CTimeSpan t) const
inline

Operator to test if time span is greater or equal.

Definition at line 2675 of file ncbitime.hpp.

References t.

◆ Reset()

void CStopWatch::Reset ( void  )
inline

◆ Restart()

double CStopWatch::Restart ( void  )
inline

◆ Round()

CTime & CTime::Round ( ERoundPrecision  precision = eRound_Day,
EDaylight  adl = eDaylightDefault 
)

Round time.

Round stored time to specified precision. All time components with precision less that specified will be zero-filled, all other components will be adjusted accordingly to rules for rounding numbers.

Parameters
precisionRounding precision.
adlWhether to adjust for daylight saving time. Default is to adjust for daylight saving time. This parameter is for eLocal time zone and where the time zone precision is not eNone.
See also
ERoundPrecision, Truncate

Definition at line 1923 of file ncbitime.cpp.

References CTime::AddDay(), CTime::AddHour(), CTime::AddMinute(), CTime::AddSecond(), CTime::eRound_Day, CTime::eRound_Hour, CTime::eRound_Microsecond, CTime::eRound_Millisecond, CTime::eRound_Minute, CTime::eRound_Second, CTime::TData::hour, CTime::IsEmptyDate(), kNanoSecondsPerSecond, CTime::m_Data, CTime::TData::min, CTime::TData::nanosec, NCBI_THROW, precision, CTime::TData::sec, and CTime::Truncate().

Referenced by CApplogUrl::ComposeUrl().

◆ Second()

int CTime::Second ( void  ) const
inline

◆ Set() [1/6]

void CTimeout::Set ( const CTimeSpan ts)

◆ Set() [2/6]

void CTimeout::Set ( double  sec)

Set timeout from number of seconds (fractional value).

Definition at line 3612 of file ncbitime.cpp.

References NStr::DoubleToString(), CTimeout::eFinite, int, kMax_UInt, kNanoSecondsPerSecond, CTimeout::m_NanoSec, CTimeout::m_Sec, CTimeout::m_Type, and NCBI_THROW.

◆ Set() [3/6]

void CTimeSpan::Set ( double  seconds)

Set time span from number of seconds (fractional value).

Definition at line 2318 of file ncbitime.cpp.

References NStr::DoubleToString(), kNanoSecondsPerSecond, CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, NCBI_THROW, and CTimeSpan::x_Normalize().

◆ Set() [4/6]

void CTimeout::Set ( EType  type)

◆ Set() [5/6]

void CTimeSpan::Set ( long  seconds,
long  nanoseconds = 0 
)
inline

Set time span in seconds and nanoseconds.

Definition at line 2571 of file ncbitime.hpp.

References kNanoSecondsPerSecond, CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, and CTimeSpan::x_Normalize().

Referenced by CTimeSpan::CTimeSpan(), and CRetryContext::SetDelay().

◆ Set() [6/6]

void CTimeout::Set ( unsigned int  sec,
unsigned int  microsec 
)

Set timeout in seconds and microseconds.

Definition at line 3595 of file ncbitime.cpp.

References CTimeout::eFinite, int, kMicroSecondsPerSecond, kNanoSecondsPerSecond, CTimeout::m_NanoSec, CTimeout::m_Sec, and CTimeout::m_Type.

◆ SetCurrent()

CTime & CTime::SetCurrent ( void  )
inline

◆ SetDay()

void CTime::SetDay ( int  day)

Set day.

Beware that this operation is inherently inconsistent. In case of number of days in the months, the day number can change, e.g.:

  • "Feb 01 2000".SetDay(31) => "Feb 29 2000".
    Parameters
    dayDay to set. Day of the month = 1..31.
    See also
    Day

Definition at line 1074 of file ncbitime.cpp.

References CHECK_RANGE_DAY, CTime::DaysInMonth(), NStr::IntToString(), CTime::IsValid(), NCBI_THROW, and SET_DAY.

◆ SetFormat() [1/5]

void CTimeFormat::SetFormat ( const char *  fmt,
TFlags  flags = fDefault 
)
inline

Set the current time format.

Parameters
fmtString of symbols describing the time format.
flagsFlags specifying how to match a time string against format string.
See also
GetFormat, EFormat, EFlags

Definition at line 2230 of file ncbitime.hpp.

References flags.

Referenced by CEventViewModel::CEventViewModel(), CTaskViewModel::CTaskViewModel(), CTimeFormat::CTimeFormat(), CTime::GetFormat(), CTimeSpan::GetFormat(), CStopWatch::GetFormat(), and CMacroFunction_Date::TheFunction().

◆ SetFormat() [2/5]

void CTime::SetFormat ( const CTimeFormat fmt)
static

Set the current time format.

The default format is: "M/D/Y h:m:s".

Parameters
fmtAn object contains string of symbols describing the time format and its type. The following format letters have the special meaning:
  • Y = year with century
  • y = year without century (00-99)
  • M = month as decimal number (01-12)
  • B = full month name (January-December)
  • b = abbreviated month name (Jan-Dec)
  • D = day as decimal number (01-31)
  • d = day as decimal number (w/o 0) (1-31)
  • H = hour in 12-hour format (00-12)
  • h = hour in 24-hour format (00-23)
  • m = minute as decimal number (00-59)
  • s = second as decimal number (00-59)
  • l = milliseconds as decimal number (000-999)
  • r = microseconds as decimal number (000000-999999)
  • S = nanosecond as decimal number (000000000-999999999)
  • G = seconds and fraction part of second as double value ("s.nnn") with floating number (1-9) of digits after dot.
  • g = same as "G" but w/o leading "0" if number of seconds < 10.
  • P = am/pm (AM/PM)
  • p = am/pm (am/pm)
  • W = full day of week name (Sunday-Saturday)
  • w = abbreviated day of week name (Sun-Sat)
  • Z = UTC timezone designator (GMT/UTC/Z or none)

following available on POSIX platforms only:

  • z = timezone shift ([GMT/UTC]+/-HHMM)
  • o = timezone shift (+/-HH:MM)

Format string can represent date/time partially, in this case current time, or default values, will be used to amplify time object, if possible. Current date/time cannot be used if format string contains "z" (time shift) format symbol. Also, it cannot be used if time format is ambiguous, like "Y/D". Note, that you still can use "Y/M", or even "Y", where month and day will be defined as 1; or "M/D", where year will be set as the current year.

See also
CTimeFormat, GetFormat, AsString

Definition at line 1268 of file ncbitime.cpp.

References s_TlsFormatTime.

Referenced by CPepXML::ConvertFromOMSSA().

◆ SetFormat() [3/5]

void CStopWatch::SetFormat ( const CTimeFormat fmt)
static

Set the current stopwatch time format.

The default format is: "S.n".

Parameters
fmtFormat specifier used to convert time span to string. If format is not defined, then GetFormat() will be used. Uses the same time format as CTimeSpan class.
See also
CTimeFormat, CTimeSpan::SetFormat, AsString

Definition at line 4127 of file ncbitime.cpp.

References s_TlsFormatStopWatch.

◆ SetFormat() [4/5]

void CTimeSpan::SetFormat ( const CTimeFormat format)
static

Set the current time span format.

The default format is: "-S.n".

Parameters
formatAn object contains string of letters describing the time format and its type. The format letters have the following meanings:
  • - = add minus for negative time spans
  • d = number of whole days
  • H = total whole number of hours stored in the time span
  • h = hours, "H" modulo 24 (-23 - 23)
  • M = total whole number of minutes stored in the time span
  • m = minutes, "M" modulo 60 (-59 - 59)
  • S = total whole number of seconds stored in the time span
  • s = seconds, "S" modulo 60 (-59 - 59)
  • N = total whole number of nanoseconds stored in the time span
  • n = nanoseconds (-999999999 - 999999999)
  • G = total whole number of seconds and part of second as double value ("S.n") with floating number (1-9) of digits after dot.
  • g = seconds, "S" modulo 60 and part of second as double value ("s.n") with floating number (1-9) of digits after dot.
See also
CTimeFormat, GetFormat, AsString

Definition at line 2659 of file ncbitime.cpp.

References s_TlsFormatSpan.

◆ SetFormat() [5/5]

void CTimeFormat::SetFormat ( const string fmt,
TFlags  flags = fDefault 
)

Set the current time format.

Parameters
fmtString of symbols describing the time format.
flagsFlags specifying how to match a time string against format string.
See also
GetFormat, EFormat, CTime::SetFormat, CTimeSpan::SetFormat

Definition at line 352 of file ncbitime.cpp.

References f, CTimeFormat::fFormat_Ncbi, CTimeFormat::fFormat_Simple, flags, CTimeFormat::fMatch_Strict, CTimeFormat::fMatch_Weak, CTimeFormat::m_Flags, CTimeFormat::m_Str, and NCBI_THROW.

◆ SetHour()

void CTime::SetHour ( int  hour)

Set hour.

Parameters
hourHours since midnight = 0..23.
See also
Hour

Definition at line 1092 of file ncbitime.cpp.

References CHECK_RANGE_HOUR, and SET_HOUR.

Referenced by python::CCursor::GetCVariant().

◆ SetMicroSecond()

void CTime::SetMicroSecond ( long  microsecond)

Set microseconds.

Parameters
microsecondMicroseconds after the second = 0..999999.
See also
MicroSecond, SetNanoSecond

Definition at line 1120 of file ncbitime.cpp.

References CHECK_RANGE_NSEC, CTime::m_Data, and CTime::TData::nanosec.

Referenced by python::CCursor::GetCVariant(), and PopulateEntry().

◆ SetMilliSecond()

void CTime::SetMilliSecond ( long  millisecond)

Set milliseconds.

Parameters
millisecondMilliseconds after the second = 0..999.
See also
MilliSecond, SetNanoSecond

Definition at line 1113 of file ncbitime.cpp.

References CHECK_RANGE_NSEC, CTime::m_Data, and CTime::TData::nanosec.

Referenced by CBlobStatusHistoryRecord::ToString().

◆ SetMinute()

void CTime::SetMinute ( int  minute)

Set minute.

Parameters
minuteMinutes after the hour = 0..59.
See also
Minute

Definition at line 1099 of file ncbitime.cpp.

References CHECK_RANGE_MIN, and SET_MIN.

Referenced by python::CCursor::GetCVariant().

◆ SetMonth()

void CTime::SetMonth ( int  month)

Set month.

Beware that this operation is inherently inconsistent. In case of different number of days in the months, the day number can change, e.g.:

  • "Dec 31 2000".SetMonth(2) => "Feb 29 2000". Therefore e.g. calling SetMonth(1) again that result will be "Jan 28".
    Parameters
    monthMonth number to set. Month number = 1..12.
    See also
    Month

Definition at line 1057 of file ncbitime.cpp.

References CHECK_RANGE_MONTH, CTime::TData::day, CTime::DaysInMonth(), NStr::IntToString(), CTime::IsValid(), CTime::m_Data, NCBI_THROW, SET_DAY, and SET_MONTH.

◆ SetNano()

void CTimeout::SetNano ( unsigned int  sec,
unsigned int  nanosec 
)

Set timeout in seconds and nanoseconds.

Definition at line 3604 of file ncbitime.cpp.

References CTimeout::eFinite, int, kNanoSecondsPerSecond, CTimeout::m_NanoSec, CTimeout::m_Sec, and CTimeout::m_Type.

Referenced by CNanoTimeout::CNanoTimeout().

◆ SetNanoSecond()

void CTime::SetNanoSecond ( long  nanosecond)

◆ SetSecond()

void CTime::SetSecond ( int  second)

Set second.

Parameters
secondSeconds after the minute = 0..59.
See also
Second

Definition at line 1106 of file ncbitime.cpp.

References CHECK_RANGE_SEC, and SET_SEC.

Referenced by python::CCursor::GetCVariant().

◆ SetTimeDBI()

CTime & CTime::SetTimeDBI ( const TDBTimeI t)

Set time using database format time, TDBTimeI.

Object's time format will always change to eLocal after call.

Parameters
tTime to set in time object in TDBTimeI format. This is always in local time format, and seconds, and nanoseconds will be truncated.
Returns
Time object that is set.

Definition at line 1496 of file ncbitime.cpp.

References CTime::AddDay(), CTime::AddNanoSecond(), CTime::AddSecond(), CTime::eLocal, CTime::GetTimeZone(), CTime::GetTimeZonePrecision(), kNanoSecondsPerSecond, CTime::SetTimeZonePrecision(), t, and CTime::ToTime().

Referenced by CDB_DateTime::Value().

◆ SetTimeDBU()

CTime & CTime::SetTimeDBU ( const TDBTimeU t)

Set time using database format time, TDBTimeU.

Object's time format will always change to eLocal after call.

Parameters
tTime to set in time object in TDBTimeU format. This is always in local time format, and seconds, and nanoseconds will be truncated.
Returns
Time object that is set.

Definition at line 1481 of file ncbitime.cpp.

References CTime::AddDay(), CTime::AddMinute(), CTime::eLocal, CTime::GetTimeZone(), CTime::GetTimeZonePrecision(), CTime::SetTimeZonePrecision(), t, and CTime::ToTime().

Referenced by CDB_SmallDateTime::Value().

◆ SetTimeT()

CTime & CTime::SetTimeT ( const time_t  t)
inline

Set time using time_t time value.

Parameters
tTime to set in time object. This is always in UTC time format, and nanoseconds will be truncated.
Returns
Time object that is set.

Definition at line 2298 of file ncbitime.hpp.

References t, and CTime::x_SetTimeMTSafe().

Referenced by CScheduler_MT::CScheduler_MT(), CTime::CTime(), CDirEntry::GetTime(), CCgi2RCgiApp::PopulatePage(), CGridCommandLineInterfaceApp::PrintBlobMeta(), CNcbiApplogApp::Run(), s_GetBlobMeta(), CConnTest::StatefulOkay(), and CScheduler_MT::x_SchedQueueChanged().

◆ SetTimeTM()

CTime & CTime::SetTimeTM ( const struct tm &  t)

Set time using "struct tm" time value.

Parameters
tTime to set in time object. This time always represents a local time in current time zone. Time object will be set to have eLocal time format, and nanoseconds will be truncated. Note that all significant fields in the time structure should be set and have correct vales, otherwise exception will be thrown.
Returns
Time object that is set.

Definition at line 1424 of file ncbitime.cpp.

References CTime::TData::adjTimeDiff, CHECK_RANGE_DAY, CHECK_RANGE_HOUR, CHECK_RANGE_MIN, CHECK_RANGE_MONTH, CHECK_RANGE_SEC, CHECK_RANGE_YEAR, CTime::eLocal, CTime::IsValid(), CTime::m_Data, CTime::TData::nanosec, NCBI_THROW, s_TimeDump(), SET_DAY, SET_HOUR, SET_MIN, SET_MONTH, SET_SEC, SET_YEAR, t, and CTime::TData::tz.

Referenced by CTime::CTime().

◆ SetTimeZone()

CTime::ETimeZone CTime::SetTimeZone ( ETimeZone  val)
inline

Set time zone.

Definition at line 2442 of file ncbitime.hpp.

References CTime::m_Data, tmp, CTime::TData::tz, and val.

Referenced by CHttpCookie::Parse(), and CTime::SetTimeZoneFormat().

◆ SetTimeZoneFormat()

CTime::ETimeZone CTime::SetTimeZoneFormat ( ETimeZone  val)
inline

Definition at line 2450 of file ncbitime.hpp.

References CTime::SetTimeZone(), and val.

◆ SetTimeZonePrecision()

CTime::ETimeZonePrecision CTime::SetTimeZonePrecision ( ETimeZonePrecision  val)
inline

Set time zone precision.

Definition at line 2456 of file ncbitime.hpp.

References CTime::m_Data, tmp, CTime::TData::tzprec, and val.

Referenced by CFastLocalTime::CFastLocalTime(), CTime::SetTimeDBI(), CTime::SetTimeDBU(), and CTime::x_AdjustTimeImmediately().

◆ SetYear()

void CTime::SetYear ( int  year)

Set year.

Beware that this operation is inherently inconsistent. In case of different number of days in the months, the day number can change, e.g.:

  • "Feb 29 2000".SetYear(2001) => "Feb 28 2001". Because 2001 is not leap year.
    Parameters
    yearYear to set.
    See also
    Year

Definition at line 1040 of file ncbitime.cpp.

References CHECK_RANGE_YEAR, CTime::TData::day, CTime::DaysInMonth(), NStr::IntToString(), CTime::IsValid(), CTime::m_Data, NCBI_THROW, SET_DAY, and SET_YEAR.

◆ Start()

void CStopWatch::Start ( void  )
inline

Start the timer.

Do nothing if already started.

Definition at line 2764 of file ncbitime.hpp.

References CStopWatch::eStart, CStopWatch::GetTimeMark(), CStopWatch::m_Start, and CStopWatch::m_State.

Referenced by BlastdbCopyApplication::BlastdbCopyApplication(), BOOST_AUTO_TEST_CASE(), IPhyloTreeRender::BufferedRender(), CHitClustering::Build(), CPhyloTreePS::CalcForces(), CBamFileInfo::CBamFileInfo(), CBDB_SplitCursor< BDB_SplitStore, BDB_Vol >::CBDB_SplitCursor(), CBlastDBAliasApp::CBlastDBAliasApp(), CBlastDbBioseqSource::CBlastDbBioseqSource(), CBlastDbCheckApplication::CBlastDbCheckApplication(), CBlastDBCmdApp::CBlastDBCmdApp(), CBlastdbConvertApp::CBlastdbConvertApp(), CBlastFormatterApp::CBlastFormatterApp(), CBlastFormatterVdbApp::CBlastFormatterVdbApp(), CBlastMasterNode::CBlastMasterNode(), CBlastnApp::CBlastnApp(), CBlastpApp::CBlastpApp(), CBlastVdbCmdApp::CBlastVdbCmdApp(), CBlastxApp::CBlastxApp(), CConvert2BlastMaskApplication::CConvert2BlastMaskApplication(), CDeltaBlastApp::CDeltaBlastApp(), CMagicBlastApp::CMagicBlastApp(), CMakeBlastDBApp::CMakeBlastDBApp(), CMakeClusterDBApp::CMakeClusterDBApp(), CMakeProfileDBApp::CMakeProfileDBApp(), CMultiApplication::CMultiApplication(), ConvertToPairwise(), CPsiBlastApp::CPsiBlastApp(), CRPSBlastApp::CRPSBlastApp(), CRPSTBlastnApp::CRPSTBlastnApp(), CStopWatch::CStopWatch(), CTblastnApp::CTblastnApp(), CTblastxApp::CTblastxApp(), CVDBBlastnApp::CVDBBlastnApp(), CVDBTblastnApp::CVDBTblastnApp(), CExecute::Exec(), CChangePhyloTreeCommand::Execute(), CChangePhyloPropertyCmd::Execute(), CChangePhyloExpandCollapseCmd::Execute(), CQueryParsePanel::CQueryJob::Execute(), CMacroWorker::ExecuteMacros(), CFlatFileGenerator::Generate(), GetBlobReader(), CSNPDataLoader_Impl::GetChunkOnce(), CSNPFileInfo::InitializeDb(), CProcess::Kill(), CProcess::KillGroup(), IPhyloTreeRender::Layout(), CBamRefSeqInfo::LoadAlignChunk(), CSNPDataLoader_Impl::LoadBlob(), CBamRefSeqInfo::LoadMainSplit(), CBamRefSeqInfo::LoadPileupChunk(), CBamRefSeqInfo::LoadSeqChunk(), CIgBlastnApp::CIgWorker::Main(), CPhyTreeView::OnBioTreeChanged(), CSeqGraphicWidget::OnDataChanged(), CPhyTreeView::OnSomethingEdited(), CLBLASTUIDataSource::Open(), CNetBLASTUIDataSource::Open(), CBamUIDataSource::Open(), CGenBankUIDataSource::Open(), CSQLITE3_Cache::Open(), IPhyloTreeRender::PointToNode(), CTableFormatPanel::PreviewData(), CDeflineProcess::ProcessInitialize(), CSeqVectorProcess::ProcessInitialize(), CGlCgiImageApplication::ProcessRequest(), CTreeGraphicsModel::Render(), IPhyloTreeRender::Render(), CSeqDescrRetrievalJob::Run(), CAnnotMetaDataJob::Run(), CPubmedFetchApplication::Run(), CBlastInputDemoApplication::Run(), CAsnCacheTestApplication::Run(), CCacheIndexCopyApp::Run(), CConcatSeqEntriesApplication::Run(), CAsnCacheDumpSeqIdsApplication::Run(), CPrimeCacheApplication::Run(), CAsnSubCacheCreateApplication::Run(), CWalkAsnCacheApplication::Run(), CMytestApplication::Run(), CProjBulderApp::Run(), CObjConvProfile::Run(), CConvImageApp::Run(), CSubImageApp::Run(), CDbapiTestSpeedApp::RunSample(), s_GetDBTree(), CAlignSort::SAlignExtractor::SAlignExtractor(), CGBenchService::SendAppStart(), CPerfLogger::Start(), SW::SW(), CChangePhyloExpandCollapseCmd::Unexecute(), CPhyloTreePS::Update(), CAsnSubCacheCreateApplication::WriteBlobsInSubCache(), CBamRefSeqInfo::x_AddSeqChunk(), CPrimeCacheApplication::x_CacheSeqEntry(), CForceJob::x_Calculate(), CImportFeatTable::x_CreateCommand(), CAlnMultiDSBuilder::x_CreateSparseDataSource(), CComponentSearchJob::x_DoSearch(), CVcfSearchJob::x_DoSearch(), CCrossPanelIR::x_DrawCrossAlignment(), CNAUtils::x_GetAllNAIds(), CNAUtils::x_GetNAMetaData(), CRemoteBlast::x_GetSearchResultsHTTP(), CBlastVdbCmdApp::x_GetVDBBlastUtil(), CFast5colReader::x_IndexFile(), CAnnot_Collector::x_Initialize0(), CCSRARefSeqInfo::x_LoadRangesStat(), BlastdbCopyApplication::x_MakeDBwIDList(), CWorkspaceAutoSaver::x_OnSave(), CBlastVdbCmdApp::x_PrintBlastDatabaseInformation(), CBlastVdbCmdApp::x_PrintVDBPaths(), CPrimeCacheApplication::x_Process_Fasta(), CPrimeCacheApplication::x_Process_Ids(), CPhyloTreePane::x_Render(), CPhyloSlantedCladogram::x_RenderVbo(), IPhyloTreeRender::x_SetElementVisibility(), CAlignTabExportPage2::x_StartNAAlignNamesJob(), and CEditObjectFeaturePropagate::xGetEditCommandAllSequences().

◆ Stop()

void CStopWatch::Stop ( void  )
inline

◆ TimeZoneDiff()

TSeconds CTime::TimeZoneDiff ( void  ) const
inline

Get difference between local timezone for current time object and UTC in seconds.

Deprecated:
Use CTime::TimeZoneOffset() instead.

Definition at line 2479 of file ncbitime.hpp.

References CTime::TimeZoneOffset().

◆ TimeZoneName()

string CTime::TimeZoneName ( void  )

Get current time zone name.

Returns
String with time zone name for current time, if supported by OS, or empty string otherwise. This name can be any one of 3-letter abbreviated code or some arbitrary string, depending on OS.
See also
TimeZoneOffset, TimeZoneOffsetStr

Definition at line 2248 of file ncbitime.cpp.

References CTime::GetTimeT(), kEmptyStr, t, and TZName.

◆ TimeZoneOffset()

TSeconds CTime::TimeZoneOffset ( void  ) const

Get difference between local timezone for current time object and UTC in seconds.

Definition at line 2218 of file ncbitime.cpp.

References CTime::DiffWholeDays(), CTime::GetLocalTime(), CTime::GetUniversalTime(), CTime::Hour(), CTime::Minute(), and CTime::Second().

Referenced by python::ConvertCVariant2PCObject(), CTime::TimeZoneDiff(), CTime::TimeZoneOffsetStr(), and CTime::x_AdjustTimeImmediately().

◆ TimeZoneOffsetStr()

string CTime::TimeZoneOffsetStr ( void  )

Get time zone offset string in format [+/-]HHMM.

See also
TimeZoneName, TimeZoneOffset

Definition at line 2231 of file ncbitime.cpp.

References int, s_AddZeroPadInt2(), str(), and CTime::TimeZoneOffset().

◆ ToGmtTime()

CTime& CTime::ToGmtTime ( void  )
inline

Definition at line 1166 of file ncbitime.hpp.

References CTime::ToUniversalTime().

◆ ToLocalTime()

CTime & CTime::ToLocalTime ( void  )
inline

◆ ToTime()

CTime & CTime::ToTime ( ETimeZone  val)

◆ ToUniversalTime()

CTime & CTime::ToUniversalTime ( void  )
inline

Convert the time into universal (GMT/UTC) time.

Definition at line 2471 of file ncbitime.hpp.

References CTime::eUTC, and CTime::ToTime().

Referenced by CTime::DiffSecond(), CVDBMgr::GetTimestamp(), CBlobChangelogRecord::GetUpdatedTimePartition(), and CTime::ToGmtTime().

◆ Truncate() [1/2]

CTime Truncate ( const CTime t)
inline

Definition at line 2194 of file ncbitime.hpp.

References t, and tmp.

Referenced by s_GetItem(), CResultSet::x_CacheItems(), and CODBC_RowResult::x_LoadItem().

◆ Truncate() [2/2]

CTime & CTime::Truncate ( ERoundPrecision  precision = eRound_Day)

Truncate time.

Truncate stored time to specified precision. All time components with precision less that specified will be zero-filled. By default method strips hours, minutes, seconds and nanoseconds.

Parameters
precisionTruncating precision.
See also
ERoundPrecision, Round

Definition at line 1970 of file ncbitime.cpp.

References CTime::eRound_Day, CTime::eRound_Hour, CTime::eRound_Microsecond, CTime::eRound_Millisecond, CTime::eRound_Minute, CTime::eRound_Second, CTime::TData::hour, CTime::m_Data, CTime::TData::min, CTime::TData::nanosec, precision, and CTime::TData::sec.

Referenced by CTime::Round().

◆ Tuneup()

void CFastLocalTime::Tuneup ( void  )

Do unscheduled check.

Definition at line 3944 of file ncbitime.cpp.

References CTime::GetCurrentTimeT(), CFastLocalTime::m_IsTuneup, and CFastLocalTime::x_Tuneup().

◆ TuneupFastLocalTime()

void TuneupFastLocalTime ( void  )

Definition at line 4173 of file ncbitime.cpp.

References s_FastLocalTime.

◆ Update()

CCurrentTime& CCurrentTime::Update ( void  )
inline

Update current time.

Definition at line 1294 of file ncbitime.hpp.

References CTime::SetCurrent().

◆ ValidateString()

bool CTime::ValidateString ( const string str,
const CTimeFormat fmt = kEmptyStr 
)
static

Validate if string match time format.

Parameters
strString representation of time.
fmtFormat that is used to check time string. Default value of kEmptyStr, implies the format, that was previously setup using SetFormat() method, or default one.
Returns
TRUE if CTime can be initialized from "str" using format "fmt", FALSE otherwise.
See also
CTimeFormat

Definition at line 1033 of file ncbitime.cpp.

References CTime::eErr_NoThrow, CTime::GetFormat(), CTimeFormat::IsEmpty(), str(), and t.

◆ x_AddHour()

CTime & CTime::x_AddHour ( int  hours = 1,
EDaylight  daylight = eDaylightDefault,
bool  shift_time = true 
)
private

Helper method to add hour with/without shift time.

Parameter "shift_time" access or denied use time shift in process adjust hours.

Definition at line 1820 of file ncbitime.cpp.

References CTime::AddDay(), CTime::CTime(), CTime::eAdjustDaylight, CTime::eIgnoreDaylight, CTime::Hour(), CTime::IsEmptyDate(), kEmptyStr, NCBI_THROW, s_Offset(), SET_HOUR, CTime::x_AdjustTime(), and CTime::x_NeedAdjustTime().

Referenced by CTime::AddHour(), and CTime::x_AdjustTimeImmediately().

◆ x_AdjustDay()

void CTime::x_AdjustDay ( void  )
private

Helper method to adjust day number to correct value after day manipulations.

Definition at line 2331 of file ncbitime.cpp.

References CTime::Day(), CTime::DaysInMonth(), and SET_DAY.

Referenced by CTime::AddMonth().

◆ x_AdjustTime()

CTime & CTime::x_AdjustTime ( const CTime from,
bool  shift_time = true 
)
private

Helper method to adjust the time to correct timezone (across the barrier of winter & summer times) using "from" as a reference point.

This does the adjustment only if the time object:

  • contains local time, and
  • has TimeZonePrecision != CTime::eNone, and
  • differs from "from" in the TimeZonePrecision (or larger) part.

Definition at line 2340 of file ncbitime.cpp.

References CTime::Day(), CTime::eDay, CTime::eHour, CTime::eMinute, CTime::eMonth, CTime::GetTimeZonePrecision(), CTime::Hour(), CTime::Minute(), CTime::Month(), CTime::x_AdjustTimeImmediately(), and CTime::x_NeedAdjustTime().

Referenced by CTime::AddDay(), CTime::AddMinute(), CTime::AddMonth(), and CTime::x_AddHour().

◆ x_AdjustTimeImmediately()

CTime & CTime::x_AdjustTimeImmediately ( const CTime from,
bool  shift_time = true 
)
private

◆ x_AsSmartString_Precision()

string CTimeSpan::x_AsSmartString_Precision ( TSmartStringFlags  flags) const
private

◆ x_AsSmartString_Smart_Big()

string CTimeSpan::x_AsSmartString_Smart_Big ( TSmartStringFlags  flags) const
private

◆ x_AsSmartString_Smart_Small()

string CTimeSpan::x_AsSmartString_Smart_Small ( TSmartStringFlags  flags) const
private

◆ x_Hour()

int CTimeSpan::x_Hour ( void  ) const
inlineprivate

Get hour.

Hours since midnight = -23..23

Definition at line 2541 of file ncbitime.hpp.

References int, and CTimeSpan::m_Sec.

Referenced by CTimeSpan::AsString().

◆ x_Init() [1/2]

void CTimeSpan::x_Init ( const string str,
const CTimeFormat fmt 
)
private

◆ x_Init() [2/2]

bool CTime::x_Init ( const string str,
const CTimeFormat fmt,
EErrAction  err_action = eErr_Throw 
)
private

◆ x_Minute()

int CTimeSpan::x_Minute ( void  ) const
inlineprivate

Get minute.

Minutes after the hour = -59..59

Definition at line 2544 of file ncbitime.hpp.

References int, and CTimeSpan::m_Sec.

Referenced by CTimeSpan::AsString().

◆ x_NeedAdjustTime()

bool CTime::x_NeedAdjustTime ( void  ) const
inlineprivate

Helper method to check if there is a need adjust time in timezone.

Definition at line 2485 of file ncbitime.hpp.

References CTime::eLocal, CTime::eNone, CTime::GetTimeZone(), and CTime::GetTimeZonePrecision().

Referenced by CTime::AddDay(), CTime::AddMinute(), CTime::AddMonth(), CTime::x_AddHour(), and CTime::x_AdjustTime().

◆ x_Normalize()

void CTimeSpan::x_Normalize ( void  )
private

◆ x_Second()

int CTimeSpan::x_Second ( void  ) const
inlineprivate

Get second.

Seconds after the minute = -59..59

Definition at line 2547 of file ncbitime.hpp.

References int, and CTimeSpan::m_Sec.

Referenced by CTimeSpan::AsString(), and CTimeSpan::x_AsSmartString_Smart_Small().

◆ x_SetNowPlus()

void CDeadline::x_SetNowPlus ( unsigned int  seconds,
unsigned int  nanoseconds 
)
private

◆ x_SetTime()

CTime & CTime::x_SetTime ( const time_t *  t = 0)
private

Helper method to set time from 'time_t' – If "t" not specified, then set to current time.

Definition at line 1710 of file ncbitime.cpp.

References CTime::TData::adjTimeDiff, CHECK_RANGE_NSEC, CTime::eLocal, CTime::GetCurrentTimeT(), CTime::GetTimeZone(), CTime::m_Data, CTime::TData::nanosec, NCBI_THROW, SET_DAY, SET_HOUR, SET_MIN, SET_MONTH, SET_SEC, SET_YEAR, t, and rapidjson::value.

Referenced by CTime::x_SetTimeMTSafe(), and CFastLocalTime::x_Tuneup().

◆ x_SetTimeMTSafe()

CTime & CTime::x_SetTimeMTSafe ( const time_t *  t = 0)
private

Version of x_SetTime() with MT-safe locks.

Definition at line 1663 of file ncbitime.cpp.

References rapidjson::value, and CTime::x_SetTime().

Referenced by CTime::SetCurrent(), and CTime::SetTimeT().

◆ x_Tuneup()

bool CFastLocalTime::x_Tuneup ( time_t  timer,
long  nanosec 
)
private

◆ Year()

int CTime::Year ( void  ) const
inline

◆ YearDayNumber()

int CTime::YearDayNumber ( void  ) const

Get year's day number.

Year day number = 1..366

Definition at line 1134 of file ncbitime.cpp.

References _ASSERT, CTime::CTime(), first(), int, CTime::IsLeap(), s_Date2Number(), and CTime::Year().

Referenced by CTime::YearWeekNumber().

◆ YearWeekNumber()

int CTime::YearWeekNumber ( EDayOfWeek  first_day_of_week = eSunday) const

Get this date's week number within the year.

Calculate the week number in a year of a given date. The week can start on any day accordingly given parameter. First week always start with 1st January.

Parameters
week_startWhat day of week is first. Default is to use Sunday as first day of week. For Monday-based weeks use eMonday as parameter value.
Returns
Week number = 1..54.

Definition at line 1143 of file ncbitime.cpp.

References CTime::DayOfWeek(), CTime::eSaturday, NStr::IntToString(), CTime::IsEmptyDate(), NCBI_THROW, and CTime::YearDayNumber().

Referenced by CTime::MonthWeekNumber().

◆ ~CTimeout()

CTimeout::~CTimeout ( void  )
inline

Destructor.

Definition at line 1722 of file ncbitime.hpp.

Variable Documentation

◆ __pad0__

unsigned CTime::TData::__pad0__

Definition at line 1260 of file ncbitime.hpp.

◆ adjTimeDiff

Int4 CTime::TData::adjTimeDiff

◆ day

unsigned char CTime::TData::day

◆ days [1/2]

Uint2 TDBTimeU::days

◆ days [2/2]

Int4 TDBTimeI::days

◆ hour

unsigned char CTime::TData::hour

◆ kAverageDaysPerYear

const double kAverageDaysPerYear = 365.2425

The average length of the year in the Gregorian (modern) calendar (in days)

Definition at line 99 of file ncbitime.hpp.

◆ kAverageSecondsPerMonth

const TSeconds kAverageSecondsPerMonth = kAverageSecondsPerYear/12

◆ kAverageSecondsPerYear

const TSeconds kAverageSecondsPerYear = 31556952

The average length of the year in the Gregorian (modern) calendar (in seconds)

Definition at line 101 of file ncbitime.hpp.

Referenced by CTimeSpan::x_AsSmartString_Precision(), and CTimeSpan::x_AsSmartString_Smart_Big().

◆ kMicroSecondsPerSecond

const long kMicroSecondsPerSecond = 1000000

◆ kMilliSecondsPerSecond

const long kMilliSecondsPerSecond = 1000

◆ kNanoSecondsPerSecond

const long kNanoSecondsPerSecond = 1000000000

◆ m_Data

TData CTime::m_Data
private

◆ m_Daylight

int CFastLocalTime::m_Daylight
private

Cached system daylight information.

Definition at line 1925 of file ncbitime.hpp.

Referenced by CFastLocalTime::CFastLocalTime(), CFastLocalTime::GetLocalTime(), CFastLocalTime::GetLocalTimezone(), and CFastLocalTime::x_Tuneup().

◆ m_Flags

TFlags CTimeFormat::m_Flags
private

Format flags.

Definition at line 274 of file ncbitime.hpp.

Referenced by CTimeFormat::GetFlags(), CTimeFormat::operator=(), and CTimeFormat::SetFormat().

◆ m_Infinite

bool CDeadline::m_Infinite
private

Definition at line 1875 of file ncbitime.hpp.

Referenced by CDeadline::CDeadline(), and CDeadline::IsInfinite().

◆ m_IsTuneup

void* volatile CFastLocalTime::m_IsTuneup
private

◆ m_LastSysTime

time_t CFastLocalTime::m_LastSysTime
private

Last system time.

Definition at line 1923 of file ncbitime.hpp.

Referenced by CFastLocalTime::GetLocalTime(), and CFastLocalTime::x_Tuneup().

◆ m_LastTuneupTime

time_t CFastLocalTime::m_LastTuneupTime
private

◆ m_LocalTime

CTime CFastLocalTime::m_LocalTime
private

Current local time.

Definition at line 1919 of file ncbitime.hpp.

Referenced by CFastLocalTime::CFastLocalTime(), CFastLocalTime::GetLocalTime(), and CFastLocalTime::x_Tuneup().

◆ m_NanoSec [1/2]

long CTimeSpan::m_NanoSec
private

◆ m_NanoSec [2/2]

unsigned int CTimeout::m_NanoSec
private

◆ m_Nanoseconds

unsigned int CDeadline::m_Nanoseconds
private

◆ m_Sec [1/2]

long CTimeSpan::m_Sec
private

◆ m_Sec [2/2]

unsigned int CTimeout::m_Sec
private

◆ m_SecAfterHour

unsigned int CFastLocalTime::m_SecAfterHour
private

Time interval in seconds after hour.

in which we should avoid to do Tuneup().

Definition at line 1917 of file ncbitime.hpp.

Referenced by CFastLocalTime::GetLocalTime(), and CFastLocalTime::GetLocalTimezone().

◆ m_Seconds

time_t CDeadline::m_Seconds
private

◆ m_Start

double CStopWatch::m_Start
private

◆ m_State

EStart CStopWatch::m_State
private

◆ m_Str

string CTimeFormat::m_Str
private

◆ m_Timezone

int CFastLocalTime::m_Timezone
private

Cached timezone adjustment for local time.

Definition at line 1924 of file ncbitime.hpp.

Referenced by CFastLocalTime::CFastLocalTime(), CFastLocalTime::GetLocalTime(), CFastLocalTime::GetLocalTimezone(), and CFastLocalTime::x_Tuneup().

◆ m_Total

double CStopWatch::m_Total
private

Accumulated elapsed time.

Definition at line 2059 of file ncbitime.hpp.

Referenced by CStopWatch::CStopWatch(), CStopWatch::Elapsed(), CStopWatch::Reset(), CStopWatch::Restart(), and CStopWatch::Stop().

◆ m_TunedTime

CTime CFastLocalTime::m_TunedTime
private

Last tuned time (changed by Tuneup())

Definition at line 1920 of file ncbitime.hpp.

Referenced by CFastLocalTime::CFastLocalTime(), and CFastLocalTime::x_Tuneup().

◆ m_Type

EType CTimeout::m_Type
private

◆ min

unsigned char CTime::TData::min

Definition at line 1252 of file ncbitime.hpp.

Referenced by CTime::Clear(), CTime::Minute(), CTime::Round(), and CTime::Truncate().

◆ month

unsigned char CTime::TData::month

Definition at line 1249 of file ncbitime.hpp.

Referenced by CTime::Clear(), CTime::CTime(), CTime::Month(), and CTime::x_Init().

◆ nanosec

Int4 CTime::TData::nanosec

◆ sec

unsigned char CTime::TData::sec

Definition at line 1253 of file ncbitime.hpp.

Referenced by CTime::Clear(), CTime::Round(), CTime::Second(), and CTime::Truncate().

◆ time [1/2]

Uint2 TDBTimeU::time

◆ time [2/2]

Int4 TDBTimeI::time

◆ tz

ETimeZone CTime::TData::tz

◆ tzprec

ETimeZonePrecision CTime::TData::tzprec

◆ year

unsigned int CTime::TData::year

Definition at line 1248 of file ncbitime.hpp.

Referenced by CTime::Clear(), CTime::CTime(), CTime::x_Init(), and CTime::Year().

Friends

◆ CFastLocalTime

friend class CFastLocalTime
friend

Definition at line 1266 of file ncbitime.hpp.

Modified on Fri Sep 20 14:57:02 2024 by modify_doxy.py rev. 669887