A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/group__Time.html below:

NCBI C++ ToolKit: Time And Date

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...
    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...
  ◆ NCBI_TIME_BITFIELD ◆ NCBI_TIME_EMPTY_BITFIELD #define NCBI_TIME_EMPTY_BITFIELD   unsigned : 0;

Definition at line 1244 of file ncbitime.hpp.

◆ CAbsTimeout ◆ TDBTimeIPtr ◆ TDBTimeUPtr ◆ TFlags ◆ TSeconds ◆ TSmartStringFlags ◆ anonymous enum ◆ 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

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.
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]

Type of special deadlines.

Enumerator eInfinite 

Infinite deadline.

eNoWait 

No-wait, expires immediately.

Definition at line 1833 of file ncbitime.hpp.

◆ AddDay() [1/2] ◆ AddDay() [2/2]

Add specified days and adjust for daylight saving time.

Parameters
days Days to add. Default is 1 day. If negative, it will result in a "subtraction" operation. adl Whether 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] ◆ AddHour() [2/2] ◆ AddMinute() [1/2] ◆ AddMinute() [2/2]

Add specified minutes and adjust for daylight saving time.

Parameters
minutes Minutes to add. Default is 1 minute. If negative, it will result in a "subtraction" operation. adl Whether 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] ◆ AddMonth() [2/2]

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.:

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] ◆ AddNanoSecond() [2/2] CTime & CTime::AddNanoSecond ( long  nanoseconds = 1 )

Add specified nanoseconds.

Parameters
nanoseconds Nanoseconds 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] ◆ AddSecond() [2/2]

Add specified seconds.

Parameters
seconds Seconds to add. Default is 1 second. If negative, it will result in a "subtraction" operation.

Definition at line 1880 of file ncbitime.cpp.

References CTime::AddMinute(), CTime::IsEmptyDate(), NCBI_THROW, s_Offset(), CTime::Second(), and SET_SEC.

Referenced by CCgiApplication::AddLBCookie(), CTime::AddNanoSecond(), CTime::AddTimeSpan(), SThrottleStats::Adjust(), CTime::AsString(), CApplogUrl::ComposeUrl(), CFastLocalTime::GetLocalTime(), CHttpCookie::Parse(), CTime::Round(), s_ParseDateTime(), CTime::SetTimeDBI(), CTime::x_Init(), and CPoolBalancer::x_InitFromCounts().

◆ AddTimeSpan() ◆ AddYear() [1/2] ◆ AddYear() [2/2] ◆ AssignFromSmartString()

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

Parameters
str String 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]

Transform elapsed time to "smart" string.

For more details see CTimeSpan::AsSmartString().

Parameters
precision Enum value describing how many parts of time span should be returned. rounding Rounding mode. zero_mode Mode 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] ◆ AsSmartString() [3/4]

Transform time span to "smart" string.

Deprecated:
Use AsSmartString(TSmartStringFlags) instead.

Definition at line 2688 of file ncbitime.hpp.

References eRound, CTimeSpan::eSSZ_NoSkipZero, flags, CTimeSpan::fSS_NoSkipZero, CTimeSpan::fSS_Round, CTimeSpan::fSS_SkipZero, CTimeSpan::fSS_Trunc, and precision.

Referenced by CThreadPool_Impl::Abort(), CStopWatch::AsSmartString(), CNSTServiceProperties::GetTTLAsString(), CBlastMasterNode::Processing(), CNSTServiceProperties::x_GetProlongAsString(), and CNetStorageHandler::x_ProcessGetObjectInfo().

◆ AsSmartString() [4/4]

Transform time span to "smart" string.

Parameters
flags How to convert string to value.
Returns
A string representation of time span. It MUST NOT be negative, or an exception will be thrown!
See also
AssignFromSmartString, AsString, ESmartStringFlags
Note
For very big time spans it use the average length of the year in the Gregorian (modern) calendar (365.2425 days) to calculate number of months and years.

Definition at line 3189 of file ncbitime.cpp.

References _ASSERT, CTimeSpan::CTimeSpan(), eNegative, f, flags, CTimeSpan::fSS_Day, CTimeSpan::fSS_Full, CTimeSpan::fSS_Hour, CTimeSpan::fSS_Microsecond, CTimeSpan::fSS_Millisecond, CTimeSpan::fSS_Minute, CTimeSpan::fSS_Month, CTimeSpan::fSS_Nanosecond, CTimeSpan::fSS_NoSkipZero, CTimeSpan::fSS_Precision1, CTimeSpan::fSS_Precision2, CTimeSpan::fSS_Precision3, CTimeSpan::fSS_Precision4, CTimeSpan::fSS_Precision5, CTimeSpan::fSS_Precision6, CTimeSpan::fSS_Precision7, CTimeSpan::fSS_PrecisionMask, CTimeSpan::fSS_Round, CTimeSpan::fSS_Second, CTimeSpan::fSS_Short, CTimeSpan::fSS_SkipZero, CTimeSpan::fSS_Smart, CTimeSpan::fSS_Trunc, CTimeSpan::fSS_Year, CTimeSpan::GetSign(), NCBI_THROW, CTimeSpan::x_AsSmartString_Precision(), CTimeSpan::x_AsSmartString_Smart_Big(), and CTimeSpan::x_AsSmartString_Smart_Small().

◆ AsString() [1/3]

Transform time span to string.

Parameters
fmt Format specifier used to convert time span to string. If format is not defined, then GetFormat() will be used.
Returns
A string representation of time span in specified format.
See also
CTimeFormat, GetFormat, SetFormat

Definition at line 2681 of file ncbitime.cpp.

References abs, eNegative, f, CTimeFormat::fFormat_Simple, format, CTimeSpan::GetCompleteDays(), CTimeSpan::GetCompleteHours(), CTimeSpan::GetCompleteMinutes(), CTimeSpan::GetCompleteSeconds(), CTimeSpan::GetFormat(), CTimeSpan::GetNanoSecondsAfterSecond(), CTimeSpan::GetSign(), ITERATE, kFormatEscapeSymbol, s_AddInt(), s_AddZeroPadInt(), s_AddZeroPadInt2(), str(), CTimeSpan::x_Hour(), CTimeSpan::x_Minute(), and CTimeSpan::x_Second().

Referenced by CStopWatch::AsString(), CCgiStatistics::Compose_Timing(), CCgi2RCgiApp::PopulatePage(), CPeriodicTestJob::Run(), CTimeout::Set(), SNetStorageObjectRPC::SetExpiration(), and sToUserFriendlyString().

◆ AsString() [2/3]

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
fmt If 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]

Transform time to string.

Parameters
format Format specifier used to convert time to string. If "format" is not defined, then GetFormat() will be used. out_tz Output 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(), CNcbiSample_Dbapi_Simple::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() ◆ CDeadline() [1/4] ◆ CDeadline() [2/4] ◆ CDeadline() [3/4]

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
seconds Number of seconds to add to the current time nanoseconds Number 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  )

Make the time "empty",.

Definition at line 1999 of file ncbitime.cpp.

References CTime::TData::adjTimeDiff, CTime::TData::day, CTime::TData::hour, CTime::m_Data, CTime::TData::min, CTime::TData::month, CTime::TData::nanosec, CTime::TData::sec, and CTime::TData::year.

Referenced by CVariant::GetCTime(), impl::CDriverContext::MakeCDBConnection(), CHttpCookie::Parse(), CHttpCookie::Reset(), CTimeFunctions::SetDefault(), CReader::WaitBeforeNewConnection(), and CTime::x_Init().

◆ Clear() [2/2] ◆ CNanoTimeout() CNanoTimeout::CNanoTimeout ( unsigned int  seconds, unsigned int  nanoseconds  ) inline ◆ CStopWatch() [1/2] CStopWatch::CStopWatch ( bool  start ) ◆ CStopWatch() [2/2] ◆ CTime() [1/7] ◆ CTime() [2/7]

Explicit conversion constructor for string representation of time.

Construct time object from string representation of time.

Parameters
str String representation of time in format "fmt". fmt Format 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". tz If current format contains 'Z', then objects timezone will be set to:
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() [4/7]

Constructor.

Parameters
mode Whether to build time object with current time or empty time (default). tz Whether to use local time (default) or UTC. tzp What 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]

Constructor.

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

Parameters
year Year part of time. month Month part of time. Note month starts from 1. day Day part of time. Note day starts from 1. hour Hour part of time. minute Minute part of time. second Second part of time. nanosecond Nanosecond part of time. tz Whether to use local time (default) or UTC. tzp What 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() [7/7] ◆ CTimeFormat() [1/4] ◆ CTimeFormat() [2/4] ◆ CTimeFormat() [3/4] ◆ CTimeFormat() [4/4] CTimeFormat::CTimeFormat ( void  ) ◆ CTimeout() [1/5] ◆ CTimeout() [2/5] CTimeout::CTimeout ( double  sec ) inlineexplicit ◆ CTimeout() [3/5] CTimeout::CTimeout ( EType  type ) inline ◆ CTimeout() [4/5] CTimeout::CTimeout ( unsigned int  sec, unsigned int  usec  ) inline ◆ CTimeout() [5/5] CTimeout::CTimeout ( void  ) inline ◆ CTimeSpan() [1/6] ◆ CTimeSpan() [2/6] ◆ 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
seconds Second 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  ) ◆ CTimeSpan() [5/6] CTimeSpan::CTimeSpan ( long  seconds, long  nanoseconds = 0  ) inlineexplicit

Constructor.

Construct time span given the number of seconds and nanoseconds.

Parameters
seconds Second part of time. nanoseconds Nanosecond part of time.

Definition at line 2503 of file ncbitime.hpp.

References CTimeSpan::Set().

◆ CTimeSpan() [6/6] CTimeSpan::CTimeSpan ( void  ) inline ◆ CurrentTime()

Definition at line 2184 of file ncbitime.hpp.

References CTime::eCurrent.

Referenced by BOOST_AUTO_TEST_CASE(), CSequenceEditingEventHandler::CreateSeqSubmit(), CDBConnectionFactory::CServiceInfo::GetOptions(), CDBConnectionFactory::MakeDBConnection(), CCgiApplication::ShouldRestart(), CCitSubUpdater::sx_GetCitSubForSequence(), CRotatingLogStream::x_BackupName(), CProSplignJob::x_CreateOneProjectItem(), CNGAlignJob::x_CreateProjectItems(), CSplignJob::x_CreateProjectItems(), CPoolBalancer::x_GetServer(), CNetStorageHandler::x_ProcessGetObjectInfo(), CAgpConverter::x_SetCreateAndUpdateDatesToToday(), CStartItem::x_SetDate(), CMacroFunction_SetPubStatus::x_SetStatus(), CSubmissionWizard::x_SetSubmissionDate(), and CBlockingQueue< TRequest >::x_WaitForPredicate().

◆ Day() int CTime::Day ( void  ) const inline

Get day.

Day of the month = 1..31 AsString() format symbol "D".

Definition at line 2271 of file ncbitime.hpp.

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

Referenced by python::ConvertCVariant2PCObject(), CTimeToTimeTms(), CTime::DayOfWeek(), CTime::IsEmpty(), CTime::IsValid(), CTime::operator<(), CTime::operator==(), CTime::operator>(), s_Date2Number(), s_TimeDump(), CCgiCookie::SetExpTime(), CDate_std::SetToTime(), CUser_object::UpdateNcbiCleanup(), CTime::x_AdjustDay(), and CTime::x_AdjustTime().

◆ DayOfWeek() int CTime::DayOfWeek ( void  ) const ◆ DayOfWeekNameToNum() ◆ DayOfWeekNumToName() ◆ DaysInMonth() int CTime::DaysInMonth ( void  ) const ◆ DiffDay() ◆ DiffHour() ◆ DiffMinute() double CTime::DiffMinute ( const CTimet ) const inline ◆ DiffNanoSecond() double CTime::DiffNanoSecond ( const CTimet ) const inline ◆ DiffSecond()

Difference in seconds from specified time.

Definition at line 2282 of file ncbitime.cpp.

References CTime::DiffWholeDays(), CTime::GetTimeZone(), CTime::Hour(), CTime::Minute(), CTime::Second(), and CTime::ToUniversalTime().

Referenced by CCgiStatistics::Compose(), CTime::DiffDay(), CTime::DiffHour(), CTime::DiffMinute(), CTime::DiffNanoSecond(), and CTime::DiffTimeSpan().

◆ DiffTimeSpan() ◆ DiffWholeDays() ◆ 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(), CChainer::CChainerImpl::MakeChains(), 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 intsec, unsigned intmicrosec  ) const

Get timeout in seconds and microseconds.

Definition at line 3545 of file ncbitime.cpp.

References CTimeout::IsFinite(), kMicroSecondsPerSecond, kNanoSecondsPerSecond, CTimeout::m_NanoSec, CTimeout::m_Sec, CTimeout::m_Type, NCBI_THROW, and s_SpecialValueName().

Referenced by CDeadline::CDeadline(), g_CTimeoutToSTimeout(), CCgiContext::GetStreamStatus(), SNetServerImpl::SConnectDeadline::IsExpired(), and CNetScheduleNotificationHandler::WaitForNotification().

◆ 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

Get as number of seconds (fractional value).

Definition at line 3512 of file ncbitime.cpp.

References CTimeout::IsFinite(), kNanoSecondsPerSecond, CTimeout::m_NanoSec, CTimeout::m_Sec, CTimeout::m_Type, NCBI_THROW, and s_SpecialValueName().

Referenced by CNetScheduleNotificationHandler::CmdAppendTimeoutGroupAndClientInfo(), SNetServerImpl::ConnectImpl(), CTimer::PresetSeconds(), CNetICacheClientExt::ProlongBlobLifetime(), CNetScheduleNotificationHandler::RequestJobWatching(), SNetStorage_NetCacheBlob::SetExpiration(), CNSTDatabase::SetParameters(), CUsageReportAPI::SetTimeout(), and CNetStorageHandler::x_ProcessConfiguration().

◆ GetAsMilliSeconds() unsigned long CTimeout::GetAsMilliSeconds ( void  ) const

Get as number of milliseconds.

Definition at line 3490 of file ncbitime.cpp.

References CTimeout::IsFinite(), kMilliSecondsPerSecond, kNanoSecondsPerSecond, CTimeout::m_NanoSec, CTimeout::m_Sec, CTimeout::m_Type, NCBI_THROW, s_SpecialValueName(), and NStr::UIntToString().

Referenced by SNetServerImpl::ConnectAndExec(), CCgiContext::GetStreamStatus(), SNetServiceImpl::IterateUntilExecOK(), CInterProcessLock::Lock(), SRetryProcessing::operator()(), s_PeekStdin(), CRWLock::TryReadLock(), CRWLock::TryWriteLock(), CThread::WaitForAllThreads(), CConditionVariable::x_WaitForSignal(), and CAsyncWriteCache::~CAsyncWriteCache().

◆ GetAsTimeSpan() CTimeSpan CTimeout::GetAsTimeSpan ( void  ) const ◆ GetCompleteDays() long CTimeSpan::GetCompleteDays ( void  ) const inline ◆ GetCompleteHours() long CTimeSpan::GetCompleteHours ( void  ) const inline ◆ GetCompleteMinutes() long CTimeSpan::GetCompleteMinutes ( void  ) const inline ◆ GetCompleteSeconds() long CTimeSpan::GetCompleteSeconds ( void  ) const inline

Get number of complete seconds.

Definition at line 2559 of file ncbitime.hpp.

References CTimeSpan::m_Sec.

Referenced by CTime::AddTimeSpan(), CTimeSpan::AsString(), CServer_ConnectionPool::GetPollAndTimerVec(), s_ProgressCallback(), CTimeout::Set(), CRequestRateControl::Sleep(), CSrvDiagMsg::StopRequest(), sToUserFriendlyString(), CRPCClient_Base::x_Ask(), CTimeSpan::x_AsSmartString_Precision(), CTimeSpan::x_AsSmartString_Smart_Big(), CThreadPool_ServiceThread::x_Idle(), and CBlockingQueue< TRequest >::x_WaitForPredicate().

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

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

Parameters
sec The function return the number of seconds elapsed since midnight (00:00:00), January 1, 1970 UTC. nanosec Number 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, gettimeofday(), 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 ◆ GetExpirationTime() void CDeadline::GetExpirationTime ( time_t *  sec, unsigned intnanosec  ) const ◆ GetFastLocalTime() CTime GetFastLocalTime ( void  )

Quick and dirty getter of local time.

Use global object of CFastLocalTime class to obtain time. See CFastLocalTime for details.

Definition at line 4167 of file ncbitime.cpp.

References s_FastLocalTime.

Referenced by BOOST_AUTO_TEST_CASE(), CGI2GRID_ComposeHtmlPage(), SThrottleStats::Check(), CGridCommandLineInterfaceApp::Cmd_RequestJob(), CBDB_Cache::EvaluateTimeLine(), CPerfLogger::GetElapsedTime(), CServer_ConnectionPool::GetPollAndTimerVec(), CCgi2RCgiApp::GetStatus(), SNetScheduleAPIImpl::Init(), CMessageDumperSender::InputMessage(), CSimpleRebalanceStrategy::NeedRebalance(), CGridCgiSampleApplication::OnEndProcessRequest(), CMessageDumperSender::OutputMessage(), CCgi2RCgiApp::PopulatePage(), CPerfLogger::Post(), CGridCommandLineInterfaceApp::PrintJobStatusNotification(), CBDB_Cache::Purge(), s_GetFastTime(), CPerfLogger::Start(), CCgi2RCgiApp::SubmitJob(), CPerfLogger::Suspend(), and CServer_ConnectionPool::x_UpdateExpiration().

◆ GetFlags() ◆ GetFormat() [1/3] ◆ GetFormat() [2/3] ◆ GetFormat() [3/3] ◆ GetGmtTime() CTime CTime::GetGmtTime ( void  ) const inline ◆ GetLocalTime() [1/2] CTime CFastLocalTime::GetLocalTime ( void  )

Get local time.

Definition at line 3988 of file ncbitime.cpp.

References CTime::AddSecond(), Daylight, eEmptyGuard, CTime::eIgnoreDaylight, CTime::GetCurrentTimeT(), CGuard< Resource, Lock, Unlock, ReportExceptions >::Guard(), CFastLocalTime::m_Daylight, CFastLocalTime::m_IsTuneup, CFastLocalTime::m_LastSysTime, CFastLocalTime::m_LastTuneupTime, CFastLocalTime::m_LocalTime, CFastLocalTime::m_SecAfterHour, CFastLocalTime::m_Timezone, NCBI_SCHED_YIELD, CGuard< Resource, Lock, Unlock, ReportExceptions >::Release(), CTime::SetNanoSecond(), TimeZone, and CFastLocalTime::x_Tuneup().

Referenced by SDiagMessage::x_OldWrite().

◆ GetLocalTime() [2/2] CTime CTime::GetLocalTime ( void  ) const ◆ GetLocalTimezone() int CFastLocalTime::GetLocalTimezone ( void  )

Get difference in seconds between UTC and current local time (daylight information included)

Definition at line 4043 of file ncbitime.cpp.

References Daylight, CTime::GetCurrentTimeT(), CFastLocalTime::m_Daylight, CFastLocalTime::m_IsTuneup, CFastLocalTime::m_LastTuneupTime, CFastLocalTime::m_SecAfterHour, CFastLocalTime::m_Timezone, TimeZone, and CFastLocalTime::x_Tuneup().

Referenced by CBDB_Cache::GetBlobAccess(), CBDB_Cache::GetReadStream(), CBDB_Cache::GetWriteStream(), CBDB_Cache::Read(), and CBDB_Cache::x_Store().

◆ GetNano() void CTimeout::GetNano ( unsigned intsec, unsigned intnanosec  ) const ◆ GetNanoSecondsAfterSecond() long CTimeSpan::GetNanoSecondsAfterSecond ( void  ) const inline

Get number of nanoseconds.

Definition at line 2562 of file ncbitime.hpp.

References CTimeSpan::m_NanoSec.

Referenced by CTime::AddTimeSpan(), CTimeSpan::AsString(), CServer_ConnectionPool::GetPollAndTimerVec(), CTimeout::Set(), CRequestRateControl::Sleep(), CSrvDiagMsg::StopRequest(), CRPCClient_Base::x_Ask(), CTimeSpan::x_AsSmartString_Precision(), CTimeSpan::x_AsSmartString_Smart_Small(), CThreadPool_ServiceThread::x_Idle(), and CBlockingQueue< TRequest >::x_WaitForPredicate().

◆ GetPredefined()

Get predefined format.

Parameters
fmt String of symbols describing the time format. fmt_type Specify type of the format string.
Returns
A time format object.
See also
EPredefined, SetFormat

Definition at line 389 of file ncbitime.cpp.

References CTimeFormat::CTimeFormat(), CTimeFormat::fFormat_Ncbi, and flags.

Referenced by CSeqDB::GetDBMetaData(), CFileLoadMRUList::LoadFromStrings(), CProjectService::LoadSettings(), CFileLoadManager::LoadSettings(), CGenBankLoadOptionPanel::LoadSettings(), CAsnSubCacheCreateApplication::Run(), CGenBankLoadOptionPanel::SaveMruAccessions(), CProjectService::SaveSettings(), CFileLoadManager::SaveSettings(), CFileLoadMRUList::SaveToStrings(), and IBISInteraction::ToAlignAnnot().

◆ GetRemainingTime()

Get time left to the expiration.

Definition at line 3859 of file ncbitime.cpp.

References _ASSERT, CTimeout::eInfinite, int, CDeadline::IsInfinite(), kNanoSecondsPerSecond, CDeadline::m_Nanoseconds, CDeadline::m_Seconds, NCBI_THROW, s_SpecialValueName(), and CDeadline::x_SetNowPlus().

Referenced by CNetScheduleNotificationHandler::CmdAppendTimeoutGroupAndClientInfo(), SNetServerImpl::SConnectDeadline::IsExpired(), CDeadline::IsExpired(), SNetServiceImpl::IterateUntilExecOK(), CMainLoopThread::Main(), SRetryProcessing::operator()(), CNetScheduleNotificationHandler::RequestJobWatching(), SGridWorkerNodeImpl::Run(), CNetCacheWriter::TransmitImpl(), SServerNotifications::Wait(), CNetScheduleNotificationHandler::WaitForNotification(), CConditionVariable::x_WaitForSignal(), and CAsyncWriteCache::~CAsyncWriteCache().

◆ GetSign() ESign CTimeSpan::GetSign ( void  ) const inline

Get sign of time span.

Definition at line 2529 of file ncbitime.hpp.

References eNegative, ePositive, eZero, CTimeSpan::m_NanoSec, and CTimeSpan::m_Sec.

Referenced by CTime::AddTimeSpan(), CTimeSpan::AsSmartString(), CTimeSpan::AsString(), CPeriodicTestJob::Run(), CTimeout::Set(), CTimeSpan::x_AsSmartString_Precision(), CTimeSpan::x_AsSmartString_Smart_Big(), CTimeSpan::x_AsSmartString_Smart_Small(), x_FindLatestSequence(), CThreadPool_ServiceThread::x_Idle(), CSyncQueue< Type, Container, Traits >::x_LockAndWait(), CNetStorageHandler::x_ProcessSetExpTime(), CBlockingQueue< TRequest >::x_WaitForPredicate(), and CThreadPool_Impl::x_WaitForPredicate().

◆ GetString() ◆ GetTimeDBI() TDBTimeI CTime::GetTimeDBI ( void  ) const ◆ GetTimeDBU() TDBTimeU CTime::GetTimeDBU ( void  ) const ◆ GetTimeMark() double CStopWatch::GetTimeMark ( ) staticprotected ◆ GetTimeT() time_t CTime::GetTimeT ( void  ) const

Get time in time_t format.

The function return the number of seconds elapsed since midnight (00:00:00), January 1, 1970 UTC. Do not use this function if the year is before 1970.

Returns
Time in time_t format.

Definition at line 1396 of file ncbitime.cpp.

Referenced by python::ConvertCVariant2PCObject(), CSampleTest::CSampleTest(), CTimeToTimeTms(), CNetBlastJobDescriptor::FromUserObject(), CSQLITE3_Cache::GetBlobAccess(), CDBConnectionFactory::CServiceInfo::GetOptions(), CBlobChangelogRecord::GetUpdatedTimePartition(), CWigGraph::Init(), CSubSource::IsCollectionDateAfterTime(), CFileLoadMRUList::LoadFromStrings(), CProjectService::LoadSettings(), CFileLoadManager::LoadSettings(), CGenBankLoadOptionPanel::LoadSettings(), CSQLITE3_Cache::Purge(), CFileObsolete::Remove(), CNcbiApplogApp::Run(), CAsnSubCacheCreateApplication::Run(), s_DumpHeader(), CWigGraph::Save(), SBlobInserter::SBlobInserter(), CDirEntry::SetTime(), CSplitCacheApp::SetupCache(), CConnTest::StatefulOkay(), CSQLITE3_Cache::StoreSynchronous(), CMacroFunction_Date::TheFunction(), CTime::TimeZoneName(), CTime::ToTime(), CTaskViewModel::x_AddTasks(), CTime::x_AdjustTimeImmediately(), CPrimeCacheApplication::x_CacheSeqEntry(), CDumpASNIndex::x_CreateBlob(), CAppTaskService::x_ExecuteNextTaskInQueue(), CPoolBalancer::x_GetServer(), CPoolBalancer::x_InitFromCounts(), CPrimeCacheApplication::x_Process_Fasta(), CPrimeCacheApplication::x_Process_Ids(), and CSQLITE3_Cache::x_SetTimestamp().

◆ GetTimeTM() struct tm CTime::GetTimeTM ( void  ) const ◆ GetTimeZone()

Get time zone.

Definition at line 2424 of file ncbitime.hpp.

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

Referenced by CTime::DiffSecond(), CTime::GetTimeZoneFormat(), CTime::operator<(), CTime::operator==(), CTime::operator>(), CTime::SetTimeDBI(), CTime::SetTimeDBU(), CTime::ToTime(), CTime::x_AdjustTimeImmediately(), CTime::x_NeedAdjustTime(), and CTime::x_SetTime().

◆ GetTimeZoneFormat() ◆ GetTimeZonePrecision() ◆ GetUniversalTime() CTime CTime::GetUniversalTime ( void  ) const ◆ Hour() int CTime::Hour ( void  ) const inline

Get hour.

Hours since midnight = 0..23. AsString() format symbol "h".

Definition at line 2274 of file ncbitime.hpp.

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

Referenced by python::ConvertCVariant2PCObject(), CTimeToTimeTms(), CTime::DiffSecond(), CTime::IsEmpty(), CTime::IsValid(), CTime::operator<(), CTime::operator==(), CTime::operator>(), s_TimeDump(), CCgiCookie::SetExpTime(), CDate_std::SetToTime(), CTime::TimeZoneOffset(), CTime::x_AddHour(), and CTime::x_AdjustTime().

◆ Invert() void CTimeSpan::Invert ( void  ) inline ◆ IsDefault() bool CTimeout::IsDefault ( ) const inline

Definition at line 2723 of file ncbitime.hpp.

References CTimeout::eDefault, and CTimeout::m_Type.

Referenced by CDeadline::CDeadline(), CQueryImpl::Execute(), CQueryImpl::ExecuteSP(), g_CTimeoutToSTimeout(), CCgiContext::GetStreamStatus(), CInterProcessLock::Lock(), CUsageReportAPI::SetTimeout(), CConnHolder::SetTimeout(), CUsageReport::Wait(), and CHttpRequest::x_InitConnection().

◆ 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 ◆ IsEmpty() [2/3] bool CTime::IsEmpty ( void  ) const inline

Is time object empty (date and time)?

Definition at line 2377 of file ncbitime.hpp.

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

Referenced by CTime::AsString(), CHttpCookie::AsString(), CApplogUrl::ComposeUrl(), CSeqDB::GetDate(), CHttpCookie::GetExpirationStr(), CELink_Request::GetQueryString(), CESearch_Request::GetQueryString(), CCgiSession::GetSessionCookie(), CVDBMgr::GetTimestamp(), CTimeFunctions::IsDefault(), CHttpCookie::IsExpired(), CTime::IsValid(), CHttpCookie::Parse(), CPerfLogger::Post(), CCgiResponse::SetHeaderValue(), CCgiResponse::SetTrackingCookie(), CPerfLogger::Start(), CTable2AsnContext::UpdateSubmitObject(), CReader::WaitBeforeNewConnection(), CReader::x_AllocConnection(), CAsnSubCacheCreateApplication::x_GetBioseqHandle(), SDiagMessage::x_InitData(), and CPoolBalancer::x_InitFromCounts().

◆ IsEmpty() [3/3] bool CTimeSpan::IsEmpty ( void  ) const inline ◆ IsEmptyDate() bool CTime::IsEmptyDate ( void  ) const inline

Is date empty?

Definition at line 2385 of file ncbitime.hpp.

References CTime::Year().

Referenced by CTime::AddDay(), CTime::AddMinute(), CTime::AddMonth(), CTime::AddNanoSecond(), CTime::AddSecond(), CTimeToTimeTms(), CTime::DayOfWeek(), CTime::DaysInMonth(), CTime::GetLocalTime(), CTime::GetTimeTM(), CTime::GetUniversalTime(), CTime::IsDST(), CTime::Round(), s_Date2Number(), CTime::ToTime(), CTime::x_AddHour(), and CTime::YearWeekNumber().

◆ IsExpired() bool CDeadline::IsExpired ( void  ) const inline

Check if the deadline is expired.

Definition at line 1855 of file ncbitime.hpp.

References CDeadline::GetRemainingTime(), CDeadline::IsInfinite(), and CTimeout::IsZero().

Referenced by SNetServerImpl::ConnectAndExec(), CConnTest::ExtraCheckOnFailure(), CNetScheduleGetJobImpl< CMainLoopThread::CImpl >::GetJobImpl(), CTimer::IsExpired(), SSuspendResume::IsJobPullbackTimerExpired(), CDiffBase::IsTimeoutExpired(), CMainLoopThread::Main(), SRetryProcessing::operator()(), s_ConnectToNamedPipe(), CNetScheduleNotificationHandler::WaitForJobCompletion(), CNetScheduleNotificationHandler::WaitForJobEvent(), CUsageReport::x_ThreadHandler(), and CAsyncWriteCache::~CAsyncWriteCache().

◆ IsFinite() bool CTimeout::IsFinite ( ) const inline

Check if timeout holds a numeric value.

Definition at line 2735 of file ncbitime.hpp.

References CTimeout::eFinite, and CTimeout::m_Type.

Referenced by CDeadline::CDeadline(), CRemoteAppLauncher::ExecRemoteApp(), CTimeout::Get(), CTimeout::GetAsDouble(), CTimeout::GetAsMilliSeconds(), CTimeout::GetAsTimeSpan(), CTimeout::GetNano(), CCgiContext::GetStreamStatus(), CTimeout::IsZero(), SNetStorage_NetCacheBlob::SetExpiration(), SNetStorageObjectRPC::SetExpiration(), NDirectNetStorageImpl::CNetCache::SetExpiration(), and CUsageReportAPI::SetTimeout().

◆ IsGmtTime() bool CTime::IsGmtTime ( void  ) const inline ◆ IsInfinite() [1/2] bool CTimeout::IsInfinite ( void  ) const inline

Definition at line 2729 of file ncbitime.hpp.

References CTimeout::eInfinite, and CTimeout::m_Type.

Referenced by CDeadline::CDeadline(), CDiff::Diff(), CDiffText::Diff(), g_CTimeoutToSTimeout(), CCgiContext::GetStreamStatus(), CInterProcessLock::Lock(), s_PeekStdin(), CRWLock::TryReadLock(), CSemaphore::TryWait(), CRWLock::TryWriteLock(), CThread::WaitForAllThreads(), and CDiff::x_DiffHalfMatch().

◆ IsInfinite() [2/2] bool CDeadline::IsInfinite ( void  ) const inline ◆ IsLeap() bool CTime::IsLeap ( void  ) const ◆ IsLocalTime() bool CTime::IsLocalTime ( void  ) const inline ◆ IsRunning() bool CStopWatch::IsRunning ( void  ) const inline

Check state of stopwatch.

Returns
TRUE if stopwatch is "running", FALSE otherwise.
See also
Start, Stop

Definition at line 2835 of file ncbitime.hpp.

References CStopWatch::eStart, and CStopWatch::m_State.

Referenced by CGlWidgetPane::CheckOverlayTimer(), CFileHandleDiagHandler::Post(), CFileDiagHandler::Post(), CSeqEntryPresenter::Process(), CFileHandleDiagHandler::Reopen(), CFileDiagHandler::Reopen(), CFileHandleDiagHandler::WriteMessage(), CFileDiagHandler::WriteMessage(), and CAnnot_Collector::x_SearchMapped().

◆ IsUniversalTime() bool CTime::IsUniversalTime ( void  ) const inline ◆ IsValid() bool CTime::IsValid ( void  ) const

Is time valid?

Definition at line 2013 of file ncbitime.cpp.

References _ASSERT, CTime::Day(), CTime::Hour(), CTime::IsEmpty(), CTime::IsLeap(), kNanoSecondsPerSecond, CTime::m_Data, CTime::Minute(), CTime::Month(), CTime::NanoSecond(), s_DaysInMonth, CTime::Second(), CTime::TData::tz, and CTime::Year().

Referenced by CTime::AsString(), CTime::CTime(), CTime::SetDay(), CTime::SetMonth(), CTime::SetTimeTM(), CTime::SetYear(), and CTime::x_Init().

◆ IsZero() bool CTimeout::IsZero ( void  ) const

Definition at line 3476 of file ncbitime.cpp.

References CTimeout::eDefault, CTimeout::IsFinite(), CTimeout::m_NanoSec, CTimeout::m_Sec, CTimeout::m_Type, NCBI_THROW, and s_SpecialValueName().

Referenced by CDeadline::CDeadline(), CCgiContext::GetStreamStatus(), SNetServerImpl::SConnectDeadline::IsExpired(), CDeadline::IsExpired(), CMainLoopThread::Main(), CTimeout::operator<=(), SGridWorkerNodeImpl::Run(), CUsageReportAPI::SetTimeout(), CRWLock::TryReadLock(), CRWLock::TryWriteLock(), and CJobCommitterThread::WaitForTimeout().

◆ MicroSecond() long CTime::MicroSecond ( void  ) const inline ◆ MilliSecond() long CTime::MilliSecond ( void  ) const inline ◆ Minute() int CTime::Minute ( void  ) const inline

Get minute.

Minutes after the hour = 0..59 AsString() format symbol "m".

Definition at line 2277 of file ncbitime.hpp.

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

Referenced by CTime::AddMinute(), python::ConvertCVariant2PCObject(), CTimeToTimeTms(), CTime::DiffSecond(), CTime::IsEmpty(), CTime::IsValid(), CTime::operator<(), CTime::operator==(), CTime::operator>(), s_TimeDump(), CCgiCookie::SetExpTime(), CDate_std::SetToTime(), CTime::TimeZoneOffset(), and CTime::x_AdjustTime().

◆ Month() int CTime::Month ( void  ) const inline

Get month.

Month number = 1..12. AsString() format symbols "M", "B", "b".

Definition at line 2268 of file ncbitime.hpp.

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

Referenced by CTime::AddMonth(), python::ConvertCVariant2PCObject(), CTimeToTimeTms(), CTime::DayOfWeek(), CTime::DaysInMonth(), CTime::IsEmpty(), CTime::IsValid(), CTime::MonthWeekNumber(), CTime::operator<(), CTime::operator==(), CTime::operator>(), s_Date2Number(), s_TimeDump(), CCgiCookie::SetExpTime(), CDate_std::SetToTime(), CUser_object::UpdateNcbiCleanup(), and CTime::x_AdjustTime().

◆ MonthNameToNum() ◆ MonthNumToName() ◆ MonthWeekNumber() ◆ NanoSecond() long CTime::NanoSecond ( void  ) const inline

Get nano-seconds.

Nano-seconds after the second = 0..999999999 AsString() format symbol "S".

See also
MilliSecond, MicroSecond

Definition at line 2289 of file ncbitime.hpp.

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

Referenced by CTime::AddNanoSecond(), python::ConvertCVariant2PCObject(), CTime::DiffNanoSecond(), CTime::DiffTimeSpan(), CTime::IsEmpty(), CTime::IsValid(), CTime::operator<(), CTime::operator==(), CTime::operator>(), CRandom::Randomize(), s_TimeDump(), and CDirEntry::SetTime().

◆ NCBI_EXCEPTION_DEFAULT() ◆ operator string() [1/4] CTimeFormat::operator string ( void  ) const inline ◆ operator string() [2/4] CTime::operator string ( void  ) const inline ◆ operator string() [3/4] CTimeSpan::operator string ( void  ) const inline ◆ operator string() [4/4] CStopWatch::operator string ( void  ) const inline ◆ operator!=() [1/3]

Operator to test in-equality of time.

Definition at line 2353 of file ncbitime.hpp.

References t.

◆ operator!=() [2/3]

Operator to test in-equality of timeouts.

Definition at line 2741 of file ncbitime.hpp.

References t.

◆ operator!=() [3/3]

Operator to test in-equality of time span.

Definition at line 2650 of file ncbitime.hpp.

References t.

◆ operator+() [1/3] ◆ operator+() [2/3] ◆ operator+() [3/3] ◆ operator+=() [1/2] ◆ operator+=() [2/2] ◆ operator-() [1/4] ◆ operator-() [2/4] ◆ operator-() [3/4] ◆ operator-() [4/4] CTimeSpan CTimeSpan::operator- ( void  ) const inline ◆ operator-=() [1/2] ◆ operator-=() [2/2] ◆ operator<() [1/4] ◆ operator<() [2/4] ◆ operator<() [3/4] ◆ operator<() [4/4] ◆ operator<<() [1/2] ◆ operator<<() [2/2] ostream& operator<< ( ostream &  os, const CTimet  ) inline ◆ operator<=() [1/3]

Operator to test if time is earlier or equal.

Definition at line 2365 of file ncbitime.hpp.

References t.

◆ operator<=() [2/3]

Operator to test if timeout is less or equal.

Definition at line 3731 of file ncbitime.cpp.

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

◆ operator<=() [3/3]

Operator to test if time span is less or equal.

Definition at line 2681 of file ncbitime.hpp.

References t.

◆ operator=() [1/5] ◆ operator=() [2/5] ◆ operator=() [3/5] ◆ operator=() [4/5]

Assignment operator from string.

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

Definition at line 2336 of file ncbitime.hpp.

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

◆ operator=() [5/5] ◆ operator==() [1/3] ◆ operator==() [2/3] ◆ operator==() [3/3] ◆ operator>() [1/3] ◆ operator>() [2/3] ◆ operator>() [3/3] ◆ operator>=() [1/3]

Operator to test if time is later or equal.

Definition at line 2359 of file ncbitime.hpp.

References t.

◆ operator>=() [2/3] ◆ operator>=() [3/3]

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

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

Start new timer after that. Result is 0.0 if Start() or Restart() wasn't previously called.

Definition at line 2816 of file ncbitime.hpp.

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

Referenced by BOOST_AUTO_TEST_CASE(), CPhyloTreePS::CalcForces(), CNetBLASTUIDataSource::Close(), CDBConnectionFactory::CStopWatchScope::CStopWatchScope(), CDataTool::GenerateCode(), CSeqEntryPresenter::Initialize(), CChainer::CChainerImpl::MakeChains(), CAlignSort::MergeSortedFiles(), CProjectTreePanel::OnDragOver(), CGlWidgetPane::OnEnterWindow(), CPhyTreeView::OnSomethingEdited(), CGlWidgetPane::OnTipRemoved(), CGenBankUIDataSource::Open(), CSeqEntryPresenter::Process(), CBam2GraphApp::ProcessFile(), CFileHandleDiagHandler::Reopen(), CFileDiagHandler::Reopen(), CRequestRateControl::Reset(), CTimeReporter::ResetAll(), CSeqDescrRetrievalJob::Run(), CDemoApp::Run(), CWorkerNodeIdleThread::Schedule(), CFileDiagHandler::SetLogFile(), CRequestContext::StartRequest(), CWorkerNodeIdleThread::Suspend(), CPhyloTreePS::Update(), CUpdateMultiSeq_Dlg::x_CreatePairwiseAlignments(), CRemoteBlast::x_GetSearchResultsHTTP(), and CNetScheduleHandler::x_ProcessBatchStart().

◆ Round()

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
precision Rounding precision. adl Whether 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

Get second.

Seconds after the minute = 0..59 AsString() format symbol "s".

Definition at line 2280 of file ncbitime.hpp.

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

Referenced by CTime::AddSecond(), python::ConvertCVariant2PCObject(), CTimeToTimeTms(), CTime::DiffSecond(), CTime::IsEmpty(), CTime::IsValid(), CTime::operator<(), CTime::operator==(), CTime::operator>(), CRandom::Randomize(), s_TimeDump(), CCgiCookie::SetExpTime(), CDate_std::SetToTime(), and CTime::TimeZoneOffset().

◆ Set() [1/6]

Set from CTimeSpan.

Definition at line 3630 of file ncbitime.cpp.

References CTimeSpan::AsString(), CTimeout::eFinite, eNegative, CTimeSpan::GetCompleteSeconds(), CTimeSpan::GetNanoSecondsAfterSecond(), CTimeSpan::GetSign(), int, kMax_UInt, CTimeout::m_NanoSec, CTimeout::m_Sec, CTimeout::m_Type, and NCBI_THROW.

◆ Set() [2/6] void CTimeout::Set ( double  sec ) ◆ Set() [3/6] void CTimeSpan::Set ( double  seconds ) ◆ Set() [4/6] void CTimeout::Set ( EType  type )

Set special value.

Definition at line 3577 of file ncbitime.cpp.

References CTimeout::eDefault, CTimeout::eFinite, CTimeout::eInfinite, CTimeout::eZero, NStr::IntToString(), CTimeout::m_Type, NCBI_THROW, and type.

Referenced by CCDDClientPool::CCDDClientPool(), CTimeout::CTimeout(), SInputValidator::GetDeadline(), CNcbiApplogApp::Redirect(), NDirectNetStorageImpl::CNetCache::SetExpiration(), CNSTDatabase::SetParameters(), CHttpRequest::SetTimeout(), CUsageReport::Wait(), CEutilsClient::x_InitParams(), and CNetStorageHandler::x_ProcessSetExpTime().

◆ Set() [5/6] void CTimeSpan::Set ( long  seconds, long  nanoseconds = 0  ) inline ◆ Set() [6/6] void CTimeout::Set ( unsigned int  sec, unsigned int  microsec  ) ◆ SetCurrent() CTime & CTime::SetCurrent ( void  ) inline

Make the time current in the presently active time zone.

Definition at line 2301 of file ncbitime.hpp.

References CTime::x_SetTimeMTSafe().

Referenced by SThrottleStats::Adjust(), CHttpCookie::AsString(), CApplogUrl::ComposeUrl(), CTime::CTime(), CScheduler_ExecThread_Impl::Main(), CHttpCookie::Parse(), CNcbiApplogApp::Run(), CXcompareAnnotsApplication::Run(), CGBProject_ver2::SetDirtyFlag(), CCurrentTime::Update(), CTime::x_Init(), and CPoolBalancer::x_InitFromCounts().

◆ SetDay() void CTime::SetDay ( int  day ) ◆ SetFormat() [1/5] ◆ SetFormat() [2/5]

Set the current time format.

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

Parameters
fmt An object contains string of symbols describing the time format and its type. The following format letters have the special meaning:

following available on POSIX platforms only:

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] ◆ SetFormat() [4/5]

Set the current time span format.

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

Parameters
format An object contains string of letters describing the time format and its type. The format letters have the following meanings:
See also
CTimeFormat, GetFormat, AsString

Definition at line 2659 of file ncbitime.cpp.

References s_TlsFormatSpan.

◆ SetFormat() [5/5]

Set the current time format.

Parameters
fmt String of symbols describing the time format. flags Flags 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 ) ◆ SetMicroSecond() void CTime::SetMicroSecond ( long  microsecond ) ◆ SetMilliSecond() void CTime::SetMilliSecond ( long  millisecond ) ◆ SetMinute() void CTime::SetMinute ( int  minute ) ◆ 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.:

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  ) ◆ SetNanoSecond() void CTime::SetNanoSecond ( long  nanosecond )

Set nanoseconds.

Parameters
nanosecond Nanoseconds after the second = 0..999999999.
See also
NanoSecond, SetMilliSecond, SetMicroSecond

Definition at line 1127 of file ncbitime.cpp.

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

Referenced by CTarEntryInfo::GetCreationCTime(), CTarEntryInfo::GetLastAccessCTime(), CFastLocalTime::GetLocalTime(), CTarEntryInfo::GetModificationCTime(), CDirEntry::GetTime(), CTar::x_RestoreAttrs(), and CFastLocalTime::x_Tuneup().

◆ SetSecond() void CTime::SetSecond ( int  second ) ◆ SetTimeDBI()

Set time using database format time, TDBTimeI.

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

Parameters
t Time 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()

Set time using database format time, TDBTimeU.

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

Parameters
t Time 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()

Set time using time_t time value.

Parameters
t Time 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()

Set time using "struct tm" time value.

Parameters
t Time 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() ◆ SetTimeZoneFormat() ◆ SetTimeZonePrecision() ◆ 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.:

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

Suspend the timer.

Next Start() call continue to count time accured before.

Definition at line 2792 of file ncbitime.hpp.

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

Referenced by BOOST_AUTO_TEST_CASE(), CPhyloTreePS::CalcForces(), CBlastDbBioseqSource::CBlastDbBioseqSource(), CNetBLASTUIDataSource::Close(), CompressAssembly(), CSeqEntryPresenter::Finalize(), CNcbiTestApplication::InitTestFramework(), CBamRefSeqInfo::LoadAlignChunk(), CConnTestThread::Main(), CProjectTreePanel::OnBeginDrag(), CSeqGraphicWidget::OnDataChanged(), CProjectTreePanel::OnDragOver(), CProjectTreePanel::OnEndDrag(), CAppDialogs::OpenViewlDialog(), CSeqEntryPresenter::Process(), CAnnotMetaDataJob::Run(), CPubmedFetchApplication::Run(), CBlastInputDemoApplication::Run(), CGBenchService::SendAppFinish(), CWorkerNodeIdleThread::Suspend(), CPerfLogger::Suspend(), UncomressAndCreate(), CPhyloTreePS::Update(), CNAUtils::x_GetAllNAIds(), CNAUtils::x_GetNAMetaData(), CRemoteBlast::x_GetSearchResultsHTTP(), CBlastVdbCmdApp::x_GetVDBBlastUtil(), CFast5colReader::x_IndexFile(), BlastdbCopyApplication::x_MakeDBwIDList(), CWorkspaceAutoSaver::x_OnSave(), CBlastVdbCmdApp::x_PrintBlastDatabaseInformation(), CBlastVdbCmdApp::x_PrintVDBPaths(), CAnnot_Collector::x_StopSearchLimits(), and CDBConnectionFactory::CStopWatchScope::~CStopWatchScope().

◆ TimeZoneDiff() TSeconds CTime::TimeZoneDiff ( void  ) const inline ◆ TimeZoneName() string CTime::TimeZoneName ( void  ) ◆ TimeZoneOffset() TSeconds CTime::TimeZoneOffset ( void  ) const ◆ TimeZoneOffsetStr() string CTime::TimeZoneOffsetStr ( void  ) ◆ ToGmtTime() CTime& CTime::ToGmtTime ( void  ) inline ◆ ToLocalTime() CTime & CTime::ToLocalTime ( void  ) inline

Convert the time into local time.

Definition at line 2464 of file ncbitime.hpp.

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

Referenced by CApplogUrl::ComposeUrl(), CwxLogDiagHandler::DoLogRecord(), GetNetBlastJobDescription(), SLazyInitData::GetTime(), CEventViewModel::GetValueAt(), NS_FormatPreciseTime(), NST_FormatPreciseTime(), operator<<(), PopulateEntry(), s_DumpHeader(), CGenBankLoadOptionPanel::SaveMruAccessions(), CProjectService::SaveSettings(), CFileLoadManager::SaveSettings(), CFileLoadMRUList::SaveToStrings(), sFormatTimePeriod(), CBlobStatusHistoryRecord::ToString(), CTime::x_AdjustTimeImmediately(), and CMessageSlotPopupWindow::x_CreateMessageSlotPanel().

◆ ToTime()

Convert the time into specified time zone time.

Definition at line 2074 of file ncbitime.cpp.

References CTime::eLocal, CTime::GetTimeT(), CTime::GetTimeZone(), CTime::IsEmptyDate(), CTime::m_Data, NCBI_THROW, CGuard< Resource, Lock, Unlock, ReportExceptions >::Release(), SET_DAY, SET_HOUR, SET_MIN, SET_MONTH, SET_SEC, SET_YEAR, t, and CTime::TData::tz.

Referenced by CTime::SetTimeDBI(), CTime::SetTimeDBU(), CTime::ToLocalTime(), and CTime::ToUniversalTime().

◆ ToUniversalTime() CTime & CTime::ToUniversalTime ( void  ) inline ◆ Truncate() [1/2] ◆ Truncate() [2/2]

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
precision Truncating 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  ) ◆ TuneupFastLocalTime() void TuneupFastLocalTime ( void  ) ◆ Update() ◆ ValidateString() ◆ x_AddHour()

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 ◆ x_AdjustTime()

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:

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()

Helper method to forcibly adjust timezone using "from" as a reference point.

Definition at line 2365 of file ncbitime.cpp.

References CTime::TData::adjTimeDiff, CTime::eAdjustDaylight, CTime::eLocal, CTime::GetTimeT(), CTime::GetTimeZone(), CTime::GetTimeZonePrecision(), CTime::m_Data, CGuard< Resource, Lock, Unlock, ReportExceptions >::Release(), CTime::SetTimeZonePrecision(), t, CTime::TimeZoneOffset(), tmp, CTime::ToLocalTime(), and CTime::x_AddHour().

Referenced by CTime::x_AdjustTime().

◆ x_AsSmartString_Precision()

Definition at line 3009 of file ncbitime.cpp.

References _ASSERT, CTimeSpan::CTimeSpan(), eDay, eHour, eMicrosecond, eMillisecond, eMinute, eMonth, eNanosecond, eNegative, ePrecision, eSecond, eYear, flags, CTimeSpan::fSS_Full, CTimeSpan::fSS_PrecisionMask, CTimeSpan::fSS_Round, CTimeSpan::fSS_SkipZero, CTimeSpan::fSS_Smart, CTimeSpan::GetCompleteSeconds(), CTimeSpan::GetNanoSecondsAfterSecond(), CTimeSpan::GetSign(), i, kAverageSecondsPerMonth, kAverageSecondsPerYear, kNanoSecondsPerSecond, kTimeSpanUnitMultipliers, kUnitNames, NStr::LongToString(), SUnitName::name_full, SUnitName::name_short, precision, result, string, val, and rapidjson::value.

Referenced by CTimeSpan::AsSmartString().

◆ x_AsSmartString_Smart_Big()

Helpers for AsSmartString()

Definition at line 2805 of file ncbitime.cpp.

References _ASSERT, CTimeSpan::CTimeSpan(), eDay, eHour, eMicrosecond, eMinute, eMonth, eNegative, eSecond, eYear, flags, CTimeSpan::fSS_Full, CTimeSpan::fSS_Round, CTimeSpan::fSS_Smart, CTimeSpan::GetCompleteSeconds(), CTimeSpan::GetSign(), kAverageSecondsPerMonth, kAverageSecondsPerYear, kNanoSecondsPerSecond, kTimeSpanUnitMultipliers, kUnitNames, NStr::LongToString(), SUnitName::name_full, SUnitName::name_short, result, string, and val.

Referenced by CTimeSpan::AsSmartString().

◆ x_AsSmartString_Smart_Small()

Definition at line 2907 of file ncbitime.cpp.

References _ASSERT, CTimeSpan::CTimeSpan(), eMicrosecond, eMillisecond, eNanosecond, eNegative, eSecond, flags, CTimeSpan::fSS_Full, CTimeSpan::fSS_Round, CTimeSpan::fSS_Smart, CTimeSpan::GetNanoSecondsAfterSecond(), CTimeSpan::GetSign(), int, kUnitNames, len, NStr::LongToString(), n, SUnitName::name_full, SUnitName::name_short, result, string, v2, and CTimeSpan::x_Second().

Referenced by CTimeSpan::AsSmartString().

◆ x_Hour() int CTimeSpan::x_Hour ( void  ) const inlineprivate ◆ x_Init() [1/2]

Helper method to set time value from string "str" using format "fmt".

Definition at line 2480 of file ncbitime.cpp.

References CTimeSpan::Clear(), f, CTimeFormat::fFormat_Simple, CTimeFormat::fMatch_ShortFormat, CTimeFormat::fMatch_ShortTime, format, CTimeSpan::Invert(), isdigit(), kFormatEscapeSymbol, kFormatSymbolsSpan, len, CTimeSpan::m_NanoSec, CTimeSpan::m_Sec, n, NCBI_THROW, str(), NStr::StringToLong(), rapidjson::value, and CTimeSpan::x_Normalize().

Referenced by CTimeSpan::CTimeSpan(), and CTimeSpan::operator=().

◆ x_Init() [2/2]

Helper method to set time value from string "str" using format "fmt".

Definition at line 507 of file ncbitime.cpp.

References _ASSERT, CTime::AddSecond(), CHECK_RANGE2_DAY, CHECK_RANGE2_HOUR12, CHECK_RANGE2_HOUR24, CHECK_RANGE2_MIN, CHECK_RANGE2_MONTH, CHECK_RANGE2_NSEC, CHECK_RANGE2_SEC, CHECK_RANGE2_YEAR, CTime::Clear(), CTime::TData::day, CTime::DayOfWeek(), CTime::eErr_Throw, CTime::eIgnoreDaylight, CTime::eLocal, CTime::eUTC, NStr::fAllowTrailingSymbols, CTimeFormat::fFormat_Simple, CTimeFormat::fMatch_IgnoreSpaces, CTimeFormat::fMatch_ShortFormat, CTimeFormat::fMatch_ShortTime, CTimeFormat::fMatch_Weak, STzFormatCheck::fmt(), format, CTime::TData::hour, i, NStr::IntToString(), isdigit(), isspace(), CTime::IsValid(), kFormatEscapeSymbol, kFormatSymbolsTime, kMonthAbbr, kMonthFull, kWeekdayAbbr, kWeekdayFull, len, CTime::m_Data, CTime::TData::month, n, CTime::TData::nanosec, SET_DAY, SET_HOUR, SET_MIN, SET_MONTH, SET_SEC, SET_YEAR, CTime::SetCurrent(), SKIP_SPACES, str(), STzFormatCheck::str(), NStr::StringToLong(), NStr::strncasecmp(), CTime::TData::tz, rapidjson::value, X_INIT_ERROR, and CTime::TData::year.

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

◆ x_Minute() int CTimeSpan::x_Minute ( void  ) const inlineprivate ◆ x_NeedAdjustTime() bool CTime::x_NeedAdjustTime ( void  ) const inlineprivate ◆ x_Normalize() void CTimeSpan::x_Normalize ( void  ) private ◆ x_Second() int CTimeSpan::x_Second ( void  ) const inlineprivate ◆ x_SetNowPlus() void CDeadline::x_SetNowPlus ( unsigned int  seconds, unsigned int  nanoseconds  ) private ◆ x_SetTime()

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 ◆ x_Tuneup() bool CFastLocalTime::x_Tuneup ( time_t  timer, long  nanosec  ) private

Internal version of Tuneup()

Definition at line 3957 of file ncbitime.cpp.

References Daylight, int, CFastLocalTime::m_Daylight, CFastLocalTime::m_IsTuneup, CFastLocalTime::m_LastSysTime, CFastLocalTime::m_LastTuneupTime, CFastLocalTime::m_LocalTime, CFastLocalTime::m_Timezone, CFastLocalTime::m_TunedTime, NULL, CGuard< Resource, Lock, Unlock, ReportExceptions >::Release(), CTime::SetNanoSecond(), SwapPointers(), TimeZone, and CTime::x_SetTime().

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

◆ Year() int CTime::Year ( void  ) const inline

Get year.

Year = 1900 .. AsString() format symbols "Y", "y".

Definition at line 2265 of file ncbitime.hpp.

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

Referenced by CTime::AddMonth(), python::ConvertCVariant2PCObject(), CTimeToTimeTms(), CTime::DayOfWeek(), get_full_date(), CTime::IsEmpty(), CTime::IsEmptyDate(), CTime::IsLeap(), CTime::IsValid(), CTime::MonthWeekNumber(), CTime::operator<(), CTime::operator==(), CTime::operator>(), s_Date2Number(), s_TimeDump(), CCgiCookie::SetExpTime(), CDate_std::SetToTime(), CUser_object::UpdateNcbiCleanup(), and CTime::YearDayNumber().

◆ YearDayNumber() int CTime::YearDayNumber ( void  ) const ◆ YearWeekNumber() ◆ ~CTimeout() CTimeout::~CTimeout ( void  ) inline ◆ __pad0__ ◆ adjTimeDiff Int4 CTime::TData::adjTimeDiff ◆ day unsigned char CTime::TData::day ◆ days [1/2] ◆ days [2/2] ◆ 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 ◆ kAverageSecondsPerYear ◆ kMicroSecondsPerSecond const long kMicroSecondsPerSecond = 1000000

Number of microseconds in one second.

Interval for it is from 0 to 999,999.

Definition at line 91 of file ncbitime.hpp.

Referenced by CDeadline::CDeadline(), CConnTest::ExtraCheckOnFailure(), CTimeout::Get(), CTime::GetCurrentTimeT(), CSystemInfo::GetUptime(), operator>(), CTL_CursorResultExpl::ReadItem(), s_SetTimeout(), CTimeout::Set(), CNcbiApplogApp::SetInfo(), CDirEntry::SetTime(), CRequestRateControl::Sleep(), SleepMicroSec(), SleepMilliSec(), SleepSec(), and CDeadline::x_SetNowPlus().

◆ kMilliSecondsPerSecond const long kMilliSecondsPerSecond = 1000

Number milliseconds in one second.

Interval for it is from 0 to 999.

Definition at line 96 of file ncbitime.hpp.

Referenced by CTimeout::GetAsMilliSeconds(), CSystemInfo::GetUptime(), SNetServiceImpl::Init(), CProcess::Kill(), CMainLoopThread::Main(), SRetryProcessing::operator()(), s_FileTimeToCTime(), s_GetTime(), s_Win_KillGroup(), SleepMicroSec(), and SleepMilliSec().

◆ kNanoSecondsPerSecond const long kNanoSecondsPerSecond = 1000000000

Number of nanoseconds in one second.

Interval for it is from 0 to 999,999,999.

Definition at line 86 of file ncbitime.hpp.

Referenced by CTime::AddNanoSecond(), CTimeSpan::AssignFromSmartString(), CDeadline::CDeadline(), CTimeSpan::CTimeSpan(), CTime::DiffNanoSecond(), CConnTest::ExtraCheckOnFailure(), CTimeout::Get(), CTimeSpan::GetAsDouble(), CTimeout::GetAsDouble(), CTimeout::GetAsMilliSeconds(), CTime::GetCurrentTimeT(), CTL_RowResult::GetItemInternal(), CDeadline::GetRemainingTime(), CTime::GetTimeDBI(), CSystemInfo::GetUptime(), CTime::IsValid(), CTime::Round(), s_FileTimeToCTime(), CTimeSpan::Set(), CTimeout::Set(), CNcbiApplogApp::SetInfo(), CTimeout::SetNano(), CDirEntry::SetTime(), CTime::SetTimeDBI(), SleepMicroSec(), CTimeSpan::x_AsSmartString_Precision(), CTimeSpan::x_AsSmartString_Smart_Big(), CTimeSpan::x_Normalize(), CDeadline::x_SetNowPlus(), and CBlockingQueue< TRequest >::x_WaitForPredicate().

◆ m_Data

Packed members.

Definition at line 1263 of file ncbitime.hpp.

Referenced by CTime::AddNanoSecond(), CTime::Clear(), CTime::CTime(), CTime::Day(), CTime::GetTimeZone(), CTime::GetTimeZonePrecision(), CTime::Hour(), CTime::IsLocalTime(), CTime::IsUniversalTime(), CTime::IsValid(), CTime::MicroSecond(), CTime::MilliSecond(), CTime::Minute(), CTime::Month(), CTime::NanoSecond(), CTime::operator=(), CTime::Round(), CTime::Second(), CTime::SetMicroSecond(), CTime::SetMilliSecond(), CTime::SetMonth(), CTime::SetNanoSecond(), CTime::SetTimeTM(), CTime::SetTimeZone(), CTime::SetTimeZonePrecision(), CTime::SetYear(), CTime::ToTime(), CTime::Truncate(), CTime::x_AdjustTimeImmediately(), CTime::x_Init(), CTime::x_SetTime(), and CTime::Year().

◆ m_Daylight int CFastLocalTime::m_Daylight private ◆ m_Flags ◆ m_Infinite bool CDeadline::m_Infinite private ◆ m_IsTuneup void* volatile CFastLocalTime::m_IsTuneup private ◆ m_LastSysTime time_t CFastLocalTime::m_LastSysTime private ◆ m_LastTuneupTime time_t CFastLocalTime::m_LastTuneupTime private ◆ m_LocalTime CTime CFastLocalTime::m_LocalTime private ◆ m_NanoSec [1/2] long CTimeSpan::m_NanoSec private

Nanoseconds after the second.

Definition at line 1680 of file ncbitime.hpp.

Referenced by CTimeSpan::AssignFromSmartString(), CTimeSpan::Clear(), CTimeSpan::CTimeSpan(), CTimeSpan::GetAsDouble(), CTimeSpan::GetNanoSecondsAfterSecond(), CTimeSpan::GetSign(), CTimeSpan::Invert(), CTimeSpan::IsEmpty(), CTimeSpan::operator+(), CTimeSpan::operator+=(), CTimeSpan::operator-(), CTimeSpan::operator-=(), CTimeSpan::operator<(), CTimeSpan::operator=(), CTimeSpan::operator==(), CTimeSpan::operator>(), CTimeSpan::Set(), CTimeSpan::x_Init(), and CTimeSpan::x_Normalize().

◆ m_NanoSec [2/2] unsigned int CTimeout::m_NanoSec private

Nanoseconds part of the timeout.

Definition at line 1796 of file ncbitime.hpp.

Referenced by CTimeout::Get(), CTimeout::GetAsDouble(), CTimeout::GetAsMilliSeconds(), CTimeout::GetAsTimeSpan(), CTimeout::GetNano(), CTimeout::IsZero(), CTimeout::operator<(), CTimeout::operator<=(), CTimeout::operator==(), CTimeout::operator>(), CTimeout::operator>=(), CTimeout::Set(), and CTimeout::SetNano().

◆ m_Nanoseconds unsigned int CDeadline::m_Nanoseconds private ◆ m_Sec [1/2]

Seconds part of the time span.

Definition at line 1679 of file ncbitime.hpp.

Referenced by CTimeSpan::AssignFromSmartString(), CTimeSpan::Clear(), CTimeSpan::CTimeSpan(), CTimeSpan::GetAsDouble(), CTimeSpan::GetCompleteDays(), CTimeSpan::GetCompleteHours(), CTimeSpan::GetCompleteMinutes(), CTimeSpan::GetCompleteSeconds(), CTimeSpan::GetSign(), CTimeSpan::Invert(), CTimeSpan::IsEmpty(), CTimeSpan::operator+(), CTimeSpan::operator+=(), CTimeSpan::operator-(), CTimeSpan::operator-=(), CTimeSpan::operator<(), CTimeSpan::operator=(), CTimeSpan::operator==(), CTimeSpan::operator>(), CTimeSpan::Set(), CTimeSpan::x_Hour(), CTimeSpan::x_Init(), CTimeSpan::x_Minute(), CTimeSpan::x_Normalize(), and CTimeSpan::x_Second().

◆ m_Sec [2/2] unsigned int CTimeout::m_Sec private

Seconds part of the timeout.

Definition at line 1795 of file ncbitime.hpp.

Referenced by CTimeout::Get(), CTimeout::GetAsDouble(), CTimeout::GetAsMilliSeconds(), CTimeout::GetAsTimeSpan(), CTimeout::GetNano(), CTimeout::IsZero(), CTimeout::operator<(), CTimeout::operator<=(), CTimeout::operator==(), CTimeout::operator>(), CTimeout::operator>=(), CTimeout::Set(), and CTimeout::SetNano().

◆ m_SecAfterHour unsigned int CFastLocalTime::m_SecAfterHour private ◆ m_Seconds time_t CDeadline::m_Seconds private ◆ m_Start double CStopWatch::m_Start private ◆ m_State ◆ m_Str ◆ m_Timezone int CFastLocalTime::m_Timezone private ◆ m_Total double CStopWatch::m_Total private ◆ m_TunedTime CTime CFastLocalTime::m_TunedTime private ◆ m_Type

Type of timeout.

Definition at line 1794 of file ncbitime.hpp.

Referenced by CTimeout::Get(), CTimeout::GetAsDouble(), CTimeout::GetAsMilliSeconds(), CTimeout::GetAsTimeSpan(), CTimeout::GetNano(), CTimeout::IsDefault(), CTimeout::IsFinite(), CTimeout::IsInfinite(), CTimeout::IsZero(), CTimeout::operator<(), CTimeout::operator<=(), CTimeout::operator==(), CTimeout::operator>(), CTimeout::operator>=(), CTimeout::Set(), and CTimeout::SetNano().

◆ min unsigned char CTime::TData::min ◆ month unsigned char CTime::TData::month ◆ nanosec Int4 CTime::TData::nanosec

Definition at line 1261 of file ncbitime.hpp.

Referenced by CTime::AddNanoSecond(), CTime::Clear(), CTime::CTime(), CTime::MicroSecond(), CTime::MilliSecond(), CTime::NanoSecond(), CTime::Round(), CTime::SetMicroSecond(), CTime::SetMilliSecond(), CTime::SetNanoSecond(), CTime::SetTimeTM(), CTime::Truncate(), CTime::x_Init(), and CTime::x_SetTime().

◆ sec unsigned char CTime::TData::sec ◆ time [1/2] ◆ time [2/2] ◆ tz ◆ tzprec ◆ year unsigned int CTime::TData::year ◆ CFastLocalTime

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4