SNAP Library , Developer Reference  2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TSecTm Class Reference

#include <tm.h>

Collaboration diagram for TSecTm:

List of all members.

Public Member Functions

 TSecTm ()
 TSecTm (const uint &_AbsSecs)
 operator uint () const
 TSecTm (const TSecTm &SecTm)
 TSecTm (const int &YearN, const int &MonthN, const int &DayN, const int &HourN=0, const int &MinN=0, const int &SecN=0)
 TSecTm (const TTm &Tm)
 TSecTm (const PXmlTok &XmlTok)
PXmlTok GetXmlTok () const
 TSecTm (TSIn &SIn)
void Load (TSIn &SIn)
void Save (TSOut &SOut) const
TSecTmoperator= (const TSecTm &SecTm)
TSecTmoperator= (const uint &_AbsSecs)
TSecTmoperator+= (const uint &Secs)
TSecTmoperator-= (const uint &Secs)
bool operator== (const TSecTm &SecTm) const
bool operator< (const TSecTm &SecTm) const
int GetMemUsed () const
int GetPrimHashCd () const
int GetSecHashCd () const
bool IsDef () const
void Undef ()
TStr GetStr (const TLoc &Loc=lUs) const
TStr GetStr (const TTmUnit &TmUnit) const
TStr GetDtStr (const TLoc &Loc=lUs) const
TStr GetDtMdyStr () const
TStr GetDtYmdStr () const
TStr GetYmdTmStr () const
TStr GetTmStr () const
TStr GetTmMinStr () const
TStr GetDtTmSortStr () const
TStr GetDtTmSortFNmStr () const
int GetYearN () const
int GetMonthN () const
TStr GetMonthNm (const TLoc &Loc=lUs) const
int GetDayN () const
int GetDayOfWeekN () const
TStr GetDayOfWeekNm (const TLoc &Loc=lUs) const
int GetHourN () const
int GetMinN () const
int GetSecN () const
void GetComps (int &Year, int &Month, int &Day, int &Hour, int &Min, int &Sec) const
uint GetAbsSecs () const
TSecTm Round (const TTmUnit &TmUnit) const
uint GetInUnits (const TTmUnit &TmUnit) const
TStr GetDayPart () const
TSecTmAddSecs (const int &Secs)
TSecTmSubSecs (const int &Secs)
TSecTmAddMins (const int &Mins)
TSecTmSubMins (const int &Mins)
TSecTmAddHours (const int &Hours)
TSecTmSubHours (const int &Hours)
TSecTmAddDays (const int &Days)
TSecTmSubDays (const int &Days)
TSecTmAddWeeks (const int &Weeks)
TSecTmSubWeeks (const int &Weeks)
void SaveTxt (TOLx &Lx) const

Static Public Member Functions

static uint GetDSecs (const TSecTm &SecTm1, const TSecTm &SecTm2)
static TSecTm GetZeroTm ()
static TSecTm GetZeroWeekTm ()
static TSecTm GetCurTm ()
static TSecTm GetCurDtTm ()
static TSecTm GetDtTmFromHmsStr (const TStr &HmsStr)
static TSecTm GetDtTmFromMdyStr (const TStr &MdyStr)
static TSecTm GetDtTmFromDmyStr (const TStr &DmyStr)
static TSecTm GetDtTmFromMdyHmsPmStr (const TStr &MdyHmsPmStr, const char &DateSepCh='/', const char &TimeSepCh=':')
static TSecTm GetDtTmFromYmdHmsStr (const TStr &YmdHmsPmStr, const char &DateSepCh='-', const char &TimeSepCh=':')
static TSecTm GetDtTmFromStr (const TChA &YmdHmsPmStr, const int &YearId=0, const int &MonId=1, const int &DayId=2, const int &HourId=3, const int &MinId=4, const int &SecId=5)
static TSecTm GetDtTm (const int &YearN, const int &MonthN, const int &DayN)
static TSecTm GetDtTm (const TSecTm &Tm)
static TSecTm LoadTxt (TILx &Lx)

Static Private Member Functions

static bool GetTmSec (const int &YearN, const int &MonthN, const int &DayN, const int &HourN, const int &MinN, const int &SecN, uint &AbsSec)
static bool GetTmSec (struct tm &Tm, uint &AbsSec)
static bool GetTmStruct (const uint &AbsSec, struct tm &Tm)
static time_t MkGmTime (struct tm *t)

Private Attributes

TUInt AbsSecs

Detailed Description

Definition at line 81 of file tm.h.


Constructor & Destructor Documentation

TSecTm::TSecTm ( ) [inline]

Definition at line 92 of file tm.h.

Referenced by GetCurTm(), GetDtTm(), GetDtTmFromDmyStr(), GetDtTmFromStr(), GetInUnits(), GetZeroTm(), LoadTxt(), Round(), and TSecTm().

Here is the caller graph for this function:

TSecTm::TSecTm ( const uint _AbsSecs) [inline, explicit]

Definition at line 93 of file tm.h.

: AbsSecs(_AbsSecs){}
TSecTm::TSecTm ( const TSecTm SecTm) [inline]

Definition at line 95 of file tm.h.

: AbsSecs(SecTm.AbsSecs){}
TSecTm::TSecTm ( const int &  YearN,
const int &  MonthN,
const int &  DayN,
const int &  HourN = 0,
const int &  MinN = 0,
const int &  SecN = 0 
)

Definition at line 427 of file tm.cpp.

References AbsSecs, GetTmSec(), and TUInt::Val.

                                                     : AbsSecs(TUInt::Mx){
  GetTmSec(YearN, MonthN, DayN, HourN, MinN, SecN, AbsSecs.Val);
}

Here is the call graph for this function:

TSecTm::TSecTm ( const TTm Tm)

Definition at line 432 of file tm.cpp.

                           : AbsSecs(
 TSecTm(Tm.GetYear(), Tm.GetMonth(), Tm.GetDay(), Tm.GetHour(),
   Tm.GetMin(), Tm.GetSec()).GetAbsSecs()) { }
TSecTm::TSecTm ( const PXmlTok XmlTok) [explicit]

Definition at line 437 of file tm.cpp.

References AbsSecs, TXmlTok::GetIntArgVal(), and TSecTm().

                                    {
  const int Year = XmlTok->GetIntArgVal("Year");
  const int Month = XmlTok->GetIntArgVal("Month");
  const int Day = XmlTok->GetIntArgVal("Day");
  const int Hour = XmlTok->GetIntArgVal("Hour");
  const int Min = XmlTok->GetIntArgVal("Min");
  const int Sec = XmlTok->GetIntArgVal("Sec");
  AbsSecs = TSecTm(Year, Month, Day, Hour, Min, Sec).GetAbsSecs();
}

Here is the call graph for this function:

TSecTm::TSecTm ( TSIn SIn) [inline]

Definition at line 101 of file tm.h.

: AbsSecs(SIn){}

Member Function Documentation

TSecTm& TSecTm::AddDays ( const int &  Days) [inline]

Definition at line 167 of file tm.h.

References AbsSecs, IAssert, IsDef(), and TUInt::Val.

Referenced by GetZeroWeekTm().

                                  {
    IAssert(IsDef()); AbsSecs.Val+=uint(Days*24*3600); return *this;}

Here is the call graph for this function:

Here is the caller graph for this function:

TSecTm& TSecTm::AddHours ( const int &  Hours) [inline]

Definition at line 163 of file tm.h.

References AbsSecs, IAssert, IsDef(), and TUInt::Val.

Referenced by GetDtTmFromHmsStr(), GetDtTmFromMdyHmsPmStr(), and GetDtTmFromYmdHmsStr().

                                    {
    IAssert(IsDef()); AbsSecs.Val+=uint(Hours*3600); return *this;}

Here is the call graph for this function:

Here is the caller graph for this function:

TSecTm& TSecTm::AddMins ( const int &  Mins) [inline]

Definition at line 159 of file tm.h.

References AbsSecs, IAssert, IsDef(), and TUInt::Val.

Referenced by GetDtTmFromHmsStr(), GetDtTmFromMdyHmsPmStr(), and GetDtTmFromYmdHmsStr().

                                  {
    IAssert(IsDef()); AbsSecs.Val+=uint(Mins*60); return *this;}

Here is the call graph for this function:

Here is the caller graph for this function:

TSecTm& TSecTm::AddSecs ( const int &  Secs) [inline]

Definition at line 155 of file tm.h.

References AbsSecs, IAssert, IsDef(), and TUInt::Val.

Referenced by GetDtTmFromHmsStr(), GetDtTmFromMdyHmsPmStr(), and GetDtTmFromYmdHmsStr().

                                  {
    IAssert(IsDef()); AbsSecs.Val+=uint(Secs); return *this;}

Here is the call graph for this function:

Here is the caller graph for this function:

TSecTm& TSecTm::AddWeeks ( const int &  Weeks) [inline]

Definition at line 171 of file tm.h.

References AbsSecs, IAssert, IsDef(), and TUInt::Val.

                                    {
    IAssert(IsDef()); AbsSecs.Val+=uint(Weeks*7*24*3600); return *this;}

Here is the call graph for this function:

uint TSecTm::GetAbsSecs ( ) const [inline]

Definition at line 149 of file tm.h.

References AbsSecs.

Referenced by TTm::GetDateTimeInt(), TTimeNENet::GetEdgeTmBuckets(), TTimeNENet::GetTmBuckets(), TGStat::GetVal(), TNIBs::LabelBurstAutomaton(), and TTimeNENet::SaveEdgeTm().

{return AbsSecs();}

Here is the caller graph for this function:

void TSecTm::GetComps ( int &  Year,
int &  Month,
int &  Day,
int &  Hour,
int &  Min,
int &  Sec 
) const

Definition at line 610 of file tm.cpp.

References AbsSecs, EAssert, GetTmStruct(), and IsDef().

                                                                                          {
  struct tm Tm;
  EAssert(IsDef() && GetTmStruct(AbsSecs(), Tm));
  Year = Tm.tm_year+1900;
  Month = Tm.tm_mon+1;
  Day = Tm.tm_mday;
  Hour = Tm.tm_hour;
  Min = Tm.tm_min;
  Sec = Tm.tm_sec;
}

Here is the call graph for this function:

static TSecTm TSecTm::GetCurDtTm ( ) [inline, static]

Definition at line 189 of file tm.h.

References GetCurTm(), and GetDtTm().

{return GetDtTm(GetCurTm());}

Here is the call graph for this function:

TSecTm TSecTm::GetCurTm ( ) [static]

Definition at line 693 of file tm.cpp.

References GetTmSec(), IAssert, TUInt::Mx, and TSecTm().

Referenced by GetCurDtTm(), and TTimeNENet::LoadEdgeTm().

                       {
  const time_t TmSec = time(NULL);
  struct tm LocTm;
  uint AbsSec = TUInt::Mx;
  #if defined(GLib_MSN)
  localtime_s(&LocTm, &TmSec);
  #elif defined(GLib_BCB)
  LocTm = *localtime(&TmSec);
  #else
  LocTm = *localtime(&TmSec);
  #endif
  IAssert(TSecTm::GetTmSec(LocTm, AbsSec));
  return TSecTm(AbsSec);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int TSecTm::GetDayN ( ) const

Definition at line 574 of file tm.cpp.

References AbsSecs, GetTmStruct(), IAssert, and IsDef().

Referenced by TGStat::GetDay(), GetDtTmSortFNmStr(), GetDtTmSortStr(), GetStr(), GetXmlTok(), and TTm::KeepDayInDateTimeInt().

                          {
  struct tm Tm;
  IAssert(IsDef() && GetTmStruct(AbsSecs(), Tm));
  return Tm.tm_mday;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int TSecTm::GetDayOfWeekN ( ) const

Definition at line 580 of file tm.cpp.

References AbsSecs, GetTmStruct(), IAssert, and IsDef().

Referenced by GetZeroWeekTm().

                                {
  struct tm Tm;
  IAssert(IsDef() && GetTmStruct(AbsSecs(), Tm));
  return Tm.tm_wday + 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TSecTm::GetDayOfWeekNm ( const TLoc Loc = lUs) const

Definition at line 586 of file tm.cpp.

References AbsSecs, GetTmStruct(), IAssert, and IsDef().

                                                 {
  struct tm Tm;
  IAssert(IsDef() && GetTmStruct(AbsSecs(), Tm));
  return TTmInfo::GetDayOfWeekNm(Tm.tm_wday+1, Loc);
}

Here is the call graph for this function:

Definition at line 670 of file tm.cpp.

References GetHourN().

                              {
        const int Hour = GetHourN();
        if (0 <= Hour && Hour < 6) { return "Night"; }
        else if (6 <= Hour && Hour < 12) { return "Morning"; }
        else if (12 <= Hour && Hour < 18) { return "Afternoon"; }
        else if (18 <= Hour && Hour < 24) { return "Evening"; }
        return "";
}

Here is the call graph for this function:

uint TSecTm::GetDSecs ( const TSecTm SecTm1,
const TSecTm SecTm2 
) [static]

Definition at line 679 of file tm.cpp.

References AbsSecs, IAssert, and IsDef().

                                                               {
  IAssert(SecTm1.IsDef()&&SecTm2.IsDef());
  const time_t Time1= time_t(SecTm1.AbsSecs());
  const time_t Time2= time_t(SecTm2.AbsSecs());
  return uint(difftime(Time2, Time1));
}

Here is the call graph for this function:

Definition at line 497 of file tm.cpp.

References AbsSecs, TStr::Fmt(), GetTmStruct(), and IAssert.

                               {
  struct tm Tm;
  IAssert(GetTmStruct(AbsSecs(), Tm));
  return TStr::Fmt("%02d/%02d%/%04d", Tm.tm_mon+1, Tm.tm_mday, Tm.tm_year+1900);
}

Here is the call graph for this function:

TStr TSecTm::GetDtStr ( const TLoc Loc = lUs) const

Definition at line 485 of file tm.cpp.

References AbsSecs, TStr::CStr(), TStr::Fmt(), TTmInfo::GetDayOfWeekNm(), GetMonthNm(), GetTmStruct(), IAssert, and IsDef().

                                           {
  if (IsDef()){
    struct tm Tm;
    IAssert(GetTmStruct(AbsSecs(), Tm));
    return TStr::Fmt("%s %s %d %d",
      TTmInfo::GetDayOfWeekNm(Tm.tm_wday + 1, Loc).CStr(),
      TTmInfo::GetMonthNm(Tm.tm_mon + 1, Loc).CStr(), Tm.tm_year+1900);
  } else {
    return "Undef";
  }
}

Here is the call graph for this function:

TSecTm TSecTm::GetDtTm ( const int &  YearN,
const int &  MonthN,
const int &  DayN 
) [static]

Definition at line 934 of file tm.cpp.

References AbsSecs, GetTmSec(), and TSecTm().

Referenced by GetCurDtTm(), GetDtTmFromDmyStr(), GetDtTmFromMdyHmsPmStr(), GetDtTmFromMdyStr(), and GetDtTmFromYmdHmsStr().

                                                                          {
  uint AbsSecs;
  TSecTm::GetTmSec(YearN, MonthN, DayN, 0, 0, 0, AbsSecs);
  return TSecTm(AbsSecs);
}

Here is the call graph for this function:

Here is the caller graph for this function:

TSecTm TSecTm::GetDtTm ( const TSecTm Tm) [static]

Definition at line 940 of file tm.cpp.

References AbsSecs, GetHourN(), GetMinN(), and GetSecN().

                                      {
  int DaySecs=Tm.GetHourN()*3600+Tm.GetMinN()*60+Tm.GetSecN();
  TSecTm DtTm(Tm.AbsSecs-DaySecs);
  return DtTm;
}

Here is the call graph for this function:

TSecTm TSecTm::GetDtTmFromDmyStr ( const TStr DmyStr) [static]

Definition at line 762 of file tm.cpp.

References TChA::Clr(), GetDtTm(), TStr::GetInt(), GetMonthN(), TStr::Len(), TStr::ToCap(), and TSecTm().

                                                  {
  int DmyStrLen=DmyStr.Len();
  // day
  TChA ChA; int ChN=0;
  while ((ChN<DmyStrLen)&&(DmyStr[ChN]!='/')&&(DmyStr[ChN]!='-')){
    ChA+=DmyStr[ChN]; ChN++;}
  TStr DayStr=ChA;
  // month
  ChA.Clr(); ChN++;
  while ((ChN<DmyStrLen)&&(DmyStr[ChN]!='/')&&(DmyStr[ChN]!='-')){
    ChA+=DmyStr[ChN]; ChN++;}
  TStr MonthStr=ChA;
  // year
  ChA.Clr(); ChN++;
  while (ChN<DmyStrLen){
    ChA+=DmyStr[ChN]; ChN++;}
  TStr YearStr=ChA;
  // transform to numbers
  int DayN=DayStr.GetInt(-1);
  int MonthN=MonthStr.GetInt(-1);
  int YearN=YearStr.GetInt(-1);
  if (MonthN == -1){
    MonthN = TTmInfo::GetMonthN(MonthStr.ToCap()); }
  if ((DayN==-1)||(MonthN==-1)||(YearN==-1)){
    return TSecTm();
  } else {
    if (YearN<1000){
      if (YearN<70){YearN+=2000;} else {YearN+=1900;}}
    // construct the date
    return GetDtTm(YearN, MonthN, DayN);
  }
  return TSecTm();
}

Here is the call graph for this function:

TSecTm TSecTm::GetDtTmFromHmsStr ( const TStr HmsStr) [static]

Definition at line 708 of file tm.cpp.

References AddHours(), AddMins(), AddSecs(), TChA::Clr(), TStr::GetInt(), GetZeroTm(), and TStr::Len().

                                                  {
  int HmsStrLen=HmsStr.Len();
  // hour
  TChA ChA; int ChN=0;
  while ((ChN<HmsStrLen)&&(HmsStr[ChN]!=':')){ChA+=HmsStr[ChN]; ChN++;}
  TStr HourStr=ChA;
  // minute
  ChA.Clr(); ChN++;
  while ((ChN<HmsStrLen)&&(HmsStr[ChN]!=':')){ChA+=HmsStr[ChN]; ChN++;}
  TStr MinStr=ChA;
  // second
  ChA.Clr(); ChN++;
  while (ChN<HmsStrLen){ChA+=HmsStr[ChN]; ChN++;}
  TStr SecStr=ChA;
  // transform to numbers
  int HourN=HourStr.GetInt();
  int MinN=MinStr.GetInt();
  int SecN=SecStr.GetInt();
  // construct the time
  TSecTm Tm=TSecTm::GetZeroTm();
  Tm.AddHours(HourN);
  Tm.AddMins(MinN);
  Tm.AddSecs(SecN);
  return Tm;
}

Here is the call graph for this function:

TSecTm TSecTm::GetDtTmFromMdyHmsPmStr ( const TStr MdyHmsPmStr,
const char &  DateSepCh = '/',
const char &  TimeSepCh = ':' 
) [static]

Definition at line 796 of file tm.cpp.

References AddHours(), AddMins(), AddSecs(), TChA::Clr(), Fail, GetDtTm(), TStr::GetInt(), TStr::IsInt(), and TStr::Len().

                                              {
  int MdyHmsPmStrLen=MdyHmsPmStr.Len();
  // month
  TChA ChA; int ChN=0;
  while ((ChN<MdyHmsPmStrLen)&&(MdyHmsPmStr[ChN]!=DateSepCh)){
    ChA+=MdyHmsPmStr[ChN]; ChN++;}
  TStr MonthStr=ChA;
  // day
  ChA.Clr(); ChN++;
  while ((ChN<MdyHmsPmStrLen)&&(MdyHmsPmStr[ChN]!=DateSepCh)){
    ChA+=MdyHmsPmStr[ChN]; ChN++;}
  TStr DayStr=ChA;
  // year
  ChA.Clr(); ChN++;
  while ((ChN<MdyHmsPmStrLen)&&(MdyHmsPmStr[ChN]!=' ')){
    ChA+=MdyHmsPmStr[ChN]; ChN++;}
  TStr YearStr=ChA;
  // hour
  ChA.Clr(); ChN++;
  while ((ChN<MdyHmsPmStrLen)&&(MdyHmsPmStr[ChN]!=TimeSepCh)){
    ChA+=MdyHmsPmStr[ChN]; ChN++;}
  TStr HourStr=ChA;
  // minute
  ChA.Clr(); ChN++;
  while ((ChN<MdyHmsPmStrLen)&&(MdyHmsPmStr[ChN]!=TimeSepCh)){
    ChA+=MdyHmsPmStr[ChN]; ChN++;}
  TStr MinStr=ChA;
  // second
  ChA.Clr(); ChN++;
  while ((ChN<MdyHmsPmStrLen)&&(MdyHmsPmStr[ChN]!=' ')){
    ChA+=MdyHmsPmStr[ChN]; ChN++;}
  TStr SecStr=ChA;
  // AM/PM
  ChA.Clr(); ChN++;
  while (ChN<MdyHmsPmStrLen){
    ChA+=MdyHmsPmStr[ChN]; ChN++;}
  TStr AmPmStr=ChA;
  // transform to numbers
  int MonthN=MonthStr.GetInt();
  int DayN=DayStr.GetInt();
  int YearN=YearStr.GetInt();
  int HourN; int MinN; int SecN;
  if (HourStr.IsInt()){
    HourN=HourStr.GetInt();
    MinN=MinStr.GetInt();
    SecN=SecStr.GetInt();
    if (AmPmStr=="AM"){} else if (AmPmStr=="PM"){HourN+=12;} else {Fail;}
  } else {
    HourN=0; MinN=0; SecN=0;
  }
  // construct the time
  TSecTm Tm=TSecTm::GetDtTm(YearN, MonthN, DayN);
  Tm.AddHours(HourN);
  Tm.AddMins(MinN);
  Tm.AddSecs(SecN);
  return Tm;
}

Here is the call graph for this function:

TSecTm TSecTm::GetDtTmFromMdyStr ( const TStr MdyStr) [static]

Definition at line 734 of file tm.cpp.

References TChA::Clr(), GetDtTm(), TStr::GetInt(), and TStr::Len().

                                                  {
  int MdyStrLen=MdyStr.Len();
  // month
  TChA ChA; int ChN=0;
  while ((ChN<MdyStrLen)&&(MdyStr[ChN]!='/')){
    ChA+=MdyStr[ChN]; ChN++;}
  TStr MonthStr=ChA;
  // day
  ChA.Clr(); ChN++;
  while ((ChN<MdyStrLen)&&(MdyStr[ChN]!='/')){
    ChA+=MdyStr[ChN]; ChN++;}
  TStr DayStr=ChA;
  // year
  ChA.Clr(); ChN++;
  while (ChN<MdyStrLen){
    ChA+=MdyStr[ChN]; ChN++;}
  TStr YearStr=ChA;
  // transform to numbers
  int MonthN=MonthStr.GetInt();
  int DayN=DayStr.GetInt();
  int YearN=YearStr.GetInt();
  if (YearN<1000){
    if (YearN<70){YearN+=2000;} else {YearN+=1900;}}
  // construct the date
  return GetDtTm(YearN, MonthN, DayN);
}

Here is the call graph for this function:

TSecTm TSecTm::GetDtTmFromStr ( const TChA YmdHmsPmStr,
const int &  YearId = 0,
const int &  MonId = 1,
const int &  DayId = 2,
const int &  HourId = 3,
const int &  MinId = 4,
const int &  SecId = 5 
) [static]

Definition at line 911 of file tm.cpp.

References TVec< TVal >::Add(), TChA::CStr(), IAssert, TCh::IsNum(), and TSecTm().

                                                                          {
  TChA Tmp = YmdHmsPmStr;
  TVec<char *> FldV;
  // get the sequences of numbers
  for (char *c = (char *) Tmp.CStr(); *c; c++) {
    if (TCh::IsNum(*c)) {
      FldV.Add(c);
      while (TCh::IsNum(*c)) { c++; }
      c--;
    } else { *c = 0; }
  }
  const int Y = atoi(FldV[YearId]);
  const int M = atoi(FldV[MonId]);
  const int D = atoi(FldV[DayId]);
  const int H = atoi(FldV[HourId]);
  const int m = atoi(FldV[MinId]);
  const int S = atoi(FldV[SecId]);
  IAssert(Y>0 && M>0 && D>0 && M<13 && D<32);
  IAssert(H>=0 && H<24 && m>=0 && m<60 && S>=0 && S<60);
  return TSecTm(Y,M,D,H,m,S);
}

Here is the call graph for this function:

TSecTm TSecTm::GetDtTmFromYmdHmsStr ( const TStr YmdHmsPmStr,
const char &  DateSepCh = '-',
const char &  TimeSepCh = ':' 
) [static]

Definition at line 855 of file tm.cpp.

References AddHours(), AddMins(), AddSecs(), TChA::Clr(), GetDtTm(), TStr::GetInt(), TStr::IsInt(), and TStr::Len().

                                              {
  int YmdHmsPmStrLen=YmdHmsPmStr.Len();
  // year
  TChA ChA; int ChN=0;
  while ((ChN<YmdHmsPmStrLen)&&(YmdHmsPmStr[ChN]!=DateSepCh)){
    ChA+=YmdHmsPmStr[ChN]; ChN++;}
  TStr YearStr=ChA;
  // month
  ChA.Clr(); ChN++;
  while ((ChN<YmdHmsPmStrLen)&&(YmdHmsPmStr[ChN]!=DateSepCh)){
    ChA+=YmdHmsPmStr[ChN]; ChN++;}
  TStr MonthStr=ChA;
  // day
  ChA.Clr(); ChN++;
  while ((ChN<YmdHmsPmStrLen)&&(YmdHmsPmStr[ChN]!=' ')){
    ChA+=YmdHmsPmStr[ChN]; ChN++;}
  TStr DayStr=ChA;
  // hour
  ChA.Clr(); ChN++;
  while ((ChN<YmdHmsPmStrLen)&&(YmdHmsPmStr[ChN]!=TimeSepCh)){
    ChA+=YmdHmsPmStr[ChN]; ChN++;}
  TStr HourStr=ChA;
  // minute
  ChA.Clr(); ChN++;
  while ((ChN<YmdHmsPmStrLen)&&(YmdHmsPmStr[ChN]!=TimeSepCh)){
    ChA+=YmdHmsPmStr[ChN]; ChN++;}
  TStr MinStr=ChA;
  // second
  ChA.Clr(); ChN++;
  while (ChN<YmdHmsPmStrLen){
    ChA+=YmdHmsPmStr[ChN]; ChN++;}
  TStr SecStr=ChA;
  // transform to numbers
  int MonthN=MonthStr.GetInt();
  int DayN=DayStr.GetInt();
  int YearN=YearStr.GetInt();
  int HourN; int MinN; int SecN;
  if (HourStr.IsInt()){
    HourN=HourStr.GetInt();
    MinN=MinStr.GetInt();
    SecN=SecStr.GetInt();
  } else {
    HourN=0; MinN=0; SecN=0;
  }
  // construct the time
  TSecTm Tm=TSecTm::GetDtTm(YearN, MonthN, DayN);
  Tm.AddHours(HourN);
  Tm.AddMins(MinN);
  Tm.AddSecs(SecN);
  return Tm;
}

Here is the call graph for this function:

Definition at line 546 of file tm.cpp.

References GetDayN(), GetHourN(), GetMinN(), GetMonthN(), GetSecN(), GetStr(), and GetYearN().

                                     {
  return
    TInt::GetStr(GetYearN(), "%04d")+"-"+
    TInt::GetStr(GetMonthN(), "%02d")+"-"+
    TInt::GetStr(GetDayN(), "%02d")+"_"+
    TInt::GetStr(GetHourN(), "%02d")+"-"+
    TInt::GetStr(GetMinN(), "%02d")+"-"+
    TInt::GetStr(GetSecN(), "%02d");
}

Here is the call graph for this function:

Definition at line 536 of file tm.cpp.

References GetDayN(), GetHourN(), GetMinN(), GetMonthN(), GetSecN(), GetStr(), and GetYearN().

                                  {
  return
    TInt::GetStr(GetYearN(), "%04d")+"/"+
    TInt::GetStr(GetMonthN(), "%02d")+"/"+
    TInt::GetStr(GetDayN(), "%02d")+" "+
    TInt::GetStr(GetHourN(), "%02d")+":"+
    TInt::GetStr(GetMinN(), "%02d")+":"+
    TInt::GetStr(GetSecN(), "%02d");
}

Here is the call graph for this function:

Definition at line 503 of file tm.cpp.

References AbsSecs, TStr::Fmt(), GetTmStruct(), and IAssert.

                               {
  struct tm Tm;
  IAssert(GetTmStruct(AbsSecs(), Tm));
  return TStr::Fmt("%04d-%02d-%02d", Tm.tm_year+1900, Tm.tm_mon+1, Tm.tm_mday);
}

Here is the call graph for this function:

int TSecTm::GetHourN ( ) const

Definition at line 592 of file tm.cpp.

References AbsSecs, GetTmStruct(), IAssert, and IsDef().

Referenced by GetDayPart(), GetDtTm(), GetDtTmSortFNmStr(), GetDtTmSortStr(), TGStat::GetHour(), GetStr(), GetXmlTok(), and TTm::KeepHourInDateTimeInt().

                           {
  struct tm Tm;
  IAssert(IsDef() && GetTmStruct(AbsSecs(), Tm));
  return Tm.tm_hour;
}

Here is the call graph for this function:

Here is the caller graph for this function:

uint TSecTm::GetInUnits ( const TTmUnit TmUnit) const

Definition at line 646 of file tm.cpp.

References AbsSecs, Fail, TJulianDate::GetJulianDateN(), GetTmStruct(), IAssert, IsDef(), TUInt::Mx, tmu10Min, tmu12Hour, tmu15Min, tmu1Hour, tmu1Min, tmu1Sec, tmu2Hour, tmu30Min, tmu4Hour, tmu6Hour, tmuDay, tmuMonth, tmuWeek, tmuYear, and TSecTm().

                                                   {
  static const int DayZero = TJulianDate::GetJulianDateN(1, 1, 1970);
  if (TmUnit == tmu1Sec) { return AbsSecs; }
  struct tm Time;
  IAssert(IsDef() && GetTmStruct(AbsSecs(), Time));
  switch (TmUnit) {
    case tmu1Min : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, Time.tm_hour, Time.tm_min, 0).GetAbsSecs()/60;
    case tmu10Min : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, Time.tm_hour, 10*(Time.tm_min/10), 0).GetAbsSecs()/(10*60);
    case tmu15Min : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, Time.tm_hour, 15*(Time.tm_min/15), 0).GetAbsSecs()/(15*60);
    case tmu30Min : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, Time.tm_hour, 30*(Time.tm_min/30), 0).GetAbsSecs()/(30*60);
    case tmu1Hour : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, Time.tm_hour, 0, 0).GetAbsSecs()/3600;
    case tmu2Hour : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, 2*(Time.tm_hour/2), 0, 0).GetAbsSecs()/(2*3600);
    case tmu4Hour : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, 4*(Time.tm_hour/4), 0, 0).GetAbsSecs()/(4*3600);
    case tmu6Hour : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, 6*(Time.tm_hour/6), 0, 0).GetAbsSecs()/(6*3600);
    case tmu12Hour : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, 12*(Time.tm_hour/12), 0, 0).GetAbsSecs()/(12*3600);
    case tmuDay : return TJulianDate::GetJulianDateN(Time.tm_mday, Time.tm_mon+1, 1900+Time.tm_year) - DayZero;
    case tmuWeek : return (TJulianDate::GetJulianDateN(Time.tm_mday, Time.tm_mon+1, 1900+Time.tm_year)-DayZero)/7;
    case tmuMonth : return 12*(Time.tm_year-70)+Time.tm_mon+1;
    case tmuYear : return Time.tm_year+1900;
    default : Fail;
  }
  return TUInt::Mx;
}

Here is the call graph for this function:

int TSecTm::GetMemUsed ( ) const [inline]

Definition at line 117 of file tm.h.

References AbsSecs, and TUInt::GetMemUsed().

{return AbsSecs.GetMemUsed();}

Here is the call graph for this function:

int TSecTm::GetMinN ( ) const

Definition at line 598 of file tm.cpp.

References AbsSecs, GetTmStruct(), IAssert, and IsDef().

Referenced by GetDtTm(), GetDtTmSortFNmStr(), GetDtTmSortStr(), TGStat::GetMin(), GetStr(), and GetXmlTok().

                          {
  struct tm Tm;
  IAssert(IsDef() && GetTmStruct(AbsSecs(), Tm));
  return Tm.tm_min;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int TSecTm::GetMonthN ( ) const

Definition at line 562 of file tm.cpp.

References AbsSecs, GetTmStruct(), IAssert, and IsDef().

Referenced by GetDtTmFromDmyStr(), GetDtTmSortFNmStr(), GetDtTmSortStr(), TGStat::GetMonth(), GetStr(), GetXmlTok(), and TTm::KeepMonthInDateTimeInt().

                            {
  struct tm Tm;
  IAssert(IsDef() && GetTmStruct(AbsSecs(), Tm));
  return Tm.tm_mon+1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TSecTm::GetMonthNm ( const TLoc Loc = lUs) const

Definition at line 568 of file tm.cpp.

References AbsSecs, GetTmStruct(), IAssert, and IsDef().

Referenced by GetDtStr(), and GetStr().

                                             {
  struct tm Tm;
  IAssert(IsDef() && GetTmStruct(AbsSecs(), Tm));
  return TTmInfo::GetMonthNm(Tm.tm_mon+1, Loc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int TSecTm::GetPrimHashCd ( ) const [inline]

Definition at line 119 of file tm.h.

References AbsSecs, and TUInt::GetPrimHashCd().

{return AbsSecs.GetPrimHashCd();}

Here is the call graph for this function:

int TSecTm::GetSecHashCd ( ) const [inline]

Definition at line 120 of file tm.h.

References AbsSecs, and TUInt::GetSecHashCd().

{return AbsSecs.GetSecHashCd();}

Here is the call graph for this function:

int TSecTm::GetSecN ( ) const

Definition at line 604 of file tm.cpp.

References AbsSecs, GetTmStruct(), IAssert, and IsDef().

Referenced by GetDtTm(), GetDtTmSortFNmStr(), GetDtTmSortStr(), TGStat::GetSec(), GetStr(), and GetXmlTok().

                          {
  struct tm Tm;
  IAssert(IsDef() && GetTmStruct(AbsSecs(), Tm));
  return Tm.tm_sec;
}

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TSecTm::GetStr ( const TLoc Loc = lUs) const

Definition at line 458 of file tm.cpp.

References AbsSecs, TStr::CStr(), TStr::Fmt(), TTmInfo::GetDayOfWeekNm(), GetMonthNm(), GetTmStruct(), IAssert, and IsDef().

Referenced by TTimeNENet::DumpTimeStat(), GetDtTmSortFNmStr(), GetDtTmSortStr(), GetStr(), TGStat::GetTmStr(), TTimeNENet::LoadEdgeTm(), TTimeNENet::LoadFlickr(), TTimeNet::PlotMissingPast(), and TTimeNENet::PlotMissingPast().

                                         {
  if (IsDef()) {
    struct tm Tm;
    IAssert(GetTmStruct(AbsSecs(), Tm));
    // Wed May 14 15:30:17 2003
    return TStr::Fmt("%s %s %d %02d:%02d:%02d %d",
      TTmInfo::GetDayOfWeekNm(Tm.tm_wday + 1, Loc).CStr(),
      TTmInfo::GetMonthNm(Tm.tm_mon + 1, Loc).CStr(),
      Tm.tm_mday, Tm.tm_hour, Tm.tm_min, Tm.tm_sec, Tm.tm_year+1900);
  } else {
    return "Undef";
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TSecTm::GetStr ( const TTmUnit TmUnit) const

Definition at line 472 of file tm.cpp.

References TStr::Fmt(), GetDayN(), GetHourN(), GetMinN(), GetMonthN(), GetSecN(), GetStr(), GetYearN(), tmuDay, tmuMonth, and tmuYear.

                                               {
  if (TmUnit == tmuYear) {
    return TInt::GetStr(GetYearN()); }
  else if (TmUnit == tmuMonth) {
    return TStr::Fmt("%04d-%02d", GetYearN(), GetMonthN()); }
  else if (TmUnit == tmuDay) {
    return TStr::Fmt("%04d-%02d-%02d", GetYearN(), GetMonthN(), GetDayN()); }
  else {
    return TStr::Fmt("%04d-%02d-%02d %02d:%02d:%02d",
      GetYearN(), GetMonthN(), GetDayN(), GetHourN(), GetMinN(), GetSecN());
  }
}

Here is the call graph for this function:

Definition at line 526 of file tm.cpp.

References AbsSecs, TStr::Fmt(), GetTmStruct(), IAssert, and IsDef().

                               {
  if (IsDef()){
    struct tm Tm;
    IAssert(GetTmStruct(AbsSecs(), Tm));
    return TStr::Fmt("%02d:%02d", Tm.tm_min, Tm.tm_sec);
  } else {
    return "Undef";
  }
}

Here is the call graph for this function:

bool TSecTm::GetTmSec ( const int &  YearN,
const int &  MonthN,
const int &  DayN,
const int &  HourN,
const int &  MinN,
const int &  SecN,
uint AbsSec 
) [static, private]

Definition at line 363 of file tm.cpp.

Referenced by GetCurTm(), GetDtTm(), and TSecTm().

                                                                                                                                            {
  AbsSec = 0;
  // tm_isdst:
  //  - Positive if daylight saving time is in effect;
  //  - 0 if daylight saving time is not in effect;
  //  - negative if status of daylight saving time is unknown.
  //  The C run-time library assumes the United States's rules for implementing
  //  the calculation of Daylight Saving Time (DST).
  struct tm Tm;
  Tm.tm_year=YearN-1900; Tm.tm_mon=MonthN-1; Tm.tm_mday=DayN;
  Tm.tm_hour=HourN; Tm.tm_min=MinN; Tm.tm_sec=SecN;
  Tm.tm_wday=1;  Tm.tm_yday=1;
  Tm.tm_isdst=-1;
  return TSecTm::GetTmSec(Tm, AbsSec);
}

Here is the caller graph for this function:

bool TSecTm::GetTmSec ( struct tm &  Tm,
uint AbsSec 
) [static, private]

Definition at line 407 of file tm.cpp.

References TStr::CStr(), TStr::Fmt(), IAssertR, MkGmTime(), and TUInt::Mx.

                                                 {
  const time_t GmtTime = MkGmTime(&Tm);
  IAssertR(uint(GmtTime) < TUInt::Mx,
    TStr::Fmt("Time out of range: %d/%d/%d %02d:%02d:%02d",
    Tm.tm_year, Tm.tm_mon, Tm.tm_mday, Tm.tm_hour, Tm.tm_min, Tm.tm_sec).CStr());
  AbsSec = uint(GmtTime);
  return GmtTime >= 0;
}

Here is the call graph for this function:

Definition at line 516 of file tm.cpp.

References AbsSecs, TStr::Fmt(), GetTmStruct(), IAssert, and IsDef().

                            {
  if (IsDef()){
    struct tm Tm;
    IAssert(GetTmStruct(AbsSecs(), Tm));
    return TStr::Fmt("%02d:%02d:%02d", Tm.tm_hour, Tm.tm_min, Tm.tm_sec);
  } else {
    return "Undef";
  }
}

Here is the call graph for this function:

bool TSecTm::GetTmStruct ( const uint AbsSec,
struct tm &  Tm 
) [static, private]

Definition at line 416 of file tm.cpp.

Referenced by GetComps(), GetDayN(), GetDayOfWeekN(), GetDayOfWeekNm(), GetDtMdyStr(), GetDtStr(), GetDtYmdStr(), GetHourN(), GetInUnits(), GetMinN(), GetMonthN(), GetMonthNm(), GetSecN(), GetStr(), GetTmMinStr(), GetTmStr(), GetYearN(), GetYmdTmStr(), and Round().

                                                          {
  const time_t TimeT = time_t(AbsSec);
  #if defined(GLib_MSC)
  return _gmtime64_s(&Tm, &TimeT) == 0;
  #elif defined(GLib_BCB)
  Tm=*gmtime(&TimeT); return true;
  #else
  return gmtime_r(&TimeT, &Tm) != NULL;
  #endif
}

Here is the caller graph for this function:

Definition at line 447 of file tm.cpp.

References TXmlTok::AddArg(), GetDayN(), GetHourN(), GetMinN(), GetMonthN(), GetSecN(), GetYearN(), and TXmlTok::New().

                                {
  PXmlTok NodeTok = TXmlTok::New("NodeTime");
  NodeTok->AddArg("Year", GetYearN());
  NodeTok->AddArg("Month", GetMonthN());
  NodeTok->AddArg("Day", GetDayN());
  NodeTok->AddArg("Hour", GetHourN());
  NodeTok->AddArg("Min", GetMinN());
  NodeTok->AddArg("Sec", GetSecN());
  return NodeTok;
}

Here is the call graph for this function:

int TSecTm::GetYearN ( ) const

Definition at line 556 of file tm.cpp.

References AbsSecs, GetTmStruct(), IAssert, and IsDef().

Referenced by GetDtTmSortFNmStr(), GetDtTmSortStr(), GetStr(), GetXmlTok(), and TGStat::GetYear().

                           {
  struct tm Tm;
  IAssert(IsDef() && GetTmStruct(AbsSecs(), Tm));
  return Tm.tm_year+1900;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 509 of file tm.cpp.

References AbsSecs, TStr::Fmt(), GetTmStruct(), and IAssert.

                               {
  struct tm Tm;
  IAssert(GetTmStruct(AbsSecs(), Tm));
  return TStr::Fmt("%04d-%02d-%02d %02d:%02d:%02d", Tm.tm_year+1900, Tm.tm_mon+1, Tm.tm_mday, Tm.tm_hour, Tm.tm_min, Tm.tm_sec);
}

Here is the call graph for this function:

static TSecTm TSecTm::GetZeroTm ( ) [inline, static]

Definition at line 186 of file tm.h.

References TSecTm().

Referenced by GetDtTmFromHmsStr(), and GetZeroWeekTm().

{return TSecTm(0).AddHours(23);}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 686 of file tm.cpp.

References AddDays(), GetDayOfWeekN(), GetZeroTm(), and TTmInfo::MonN.

                            {
  TSecTm ZeroWeekTm=GetZeroTm();
  while (ZeroWeekTm.GetDayOfWeekN()!=TTmInfo::MonN){
    ZeroWeekTm.AddDays(1);}
  return ZeroWeekTm;
}

Here is the call graph for this function:

void TSecTm::Load ( TSIn SIn) [inline]

Definition at line 102 of file tm.h.

References AbsSecs, and TUInt::Load().

{AbsSecs.Load(SIn);}

Here is the call graph for this function:

TSecTm TSecTm::LoadTxt ( TILx Lx) [static]

Definition at line 946 of file tm.cpp.

References TILx::GetInt(), and TSecTm().

Referenced by TILx::GetVarSecTm().

                              {
  return TSecTm(Lx.GetInt());
}

Here is the call graph for this function:

Here is the caller graph for this function:

time_t TSecTm::MkGmTime ( struct tm *  t) [static, private]

Definition at line 380 of file tm.cpp.

Referenced by GetTmSec().

                                    {
  static const int m_to_d[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
  short month, year;
  time_t result;
  month = t->tm_mon;
  year = t->tm_year + month / 12 + 1900;
  month %= 12;
  if (month < 0) {
    year -= 1;
    month += 12; }
  result = (year - 1970) * 365 + (year - 1969) / 4 + m_to_d[month];
  result = (year - 1970) * 365 + m_to_d[month];
  if (month <= 1) { year -= 1; }
  result += (year - 1968) / 4;
  result -= (year - 1900) / 100;
  result += (year - 1600) / 400;
  result += t->tm_mday;
  result -= 1;
  result *= 24;
  result += t->tm_hour;
  result *= 60;
  result += t->tm_min;
  result *= 60;
  result += t->tm_sec;
  return result;
}

Here is the caller graph for this function:

TSecTm::operator uint ( ) const [inline]

Definition at line 94 of file tm.h.

References AbsSecs, and TUInt::Val.

{return AbsSecs.Val;}
TSecTm& TSecTm::operator+= ( const uint Secs) [inline]

Definition at line 109 of file tm.h.

References AbsSecs, IAssert, and IsDef().

                                      {
    IAssert(IsDef()); AbsSecs()+=Secs; return *this;}

Here is the call graph for this function:

TSecTm& TSecTm::operator-= ( const uint Secs) [inline]

Definition at line 111 of file tm.h.

References AbsSecs, IAssert, and IsDef().

                                      {
    IAssert(IsDef()); AbsSecs()-=Secs; return *this;}

Here is the call graph for this function:

bool TSecTm::operator< ( const TSecTm SecTm) const [inline]

Definition at line 115 of file tm.h.

References AbsSecs, IAssert, and IsDef().

                                            {
    IAssert(IsDef()&&SecTm.IsDef()); return AbsSecs<SecTm.AbsSecs;}

Here is the call graph for this function:

TSecTm& TSecTm::operator= ( const TSecTm SecTm) [inline]

Definition at line 105 of file tm.h.

References AbsSecs.

                                        {
    AbsSecs=SecTm.AbsSecs; return *this;}
TSecTm& TSecTm::operator= ( const uint _AbsSecs) [inline]

Definition at line 107 of file tm.h.

References AbsSecs.

                                         {
    AbsSecs=_AbsSecs; return *this;}
bool TSecTm::operator== ( const TSecTm SecTm) const [inline]

Definition at line 113 of file tm.h.

References AbsSecs.

                                             {
    return AbsSecs==SecTm.AbsSecs;}
TSecTm TSecTm::Round ( const TTmUnit TmUnit) const

Definition at line 621 of file tm.cpp.

References AbsSecs, Fail, TJulianDate::GetCalendarDate(), TJulianDate::GetJulianDateN(), GetTmStruct(), IAssert, IsDef(), tmu10Min, tmu12Hour, tmu15Min, tmu1Hour, tmu1Min, tmu1Sec, tmu2Hour, tmu30Min, tmu4Hour, tmu6Hour, tmuDay, tmuMonth, tmuWeek, tmuYear, and TSecTm().

Referenced by TTimeNENet::GetEdgeTmBuckets(), and TTimeNENet::GetTmBuckets().

                                                {
  if (TmUnit == tmu1Sec) { return *this; }
  struct tm Time;
  IAssert(IsDef() && GetTmStruct(AbsSecs(), Time));
  switch (TmUnit) {
    case tmu1Min : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, Time.tm_hour, Time.tm_min, 0);
    case tmu10Min : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, Time.tm_hour, 10*(Time.tm_min/10), 0);
    case tmu15Min : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, Time.tm_hour, 15*(Time.tm_min/15), 0);
    case tmu30Min : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, Time.tm_hour, 30*(Time.tm_min/30), 0);
    case tmu1Hour : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, Time.tm_hour, 0, 0);
    case tmu2Hour : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, 2*(Time.tm_hour/2), 0, 0);
    case tmu4Hour : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, 4*(Time.tm_hour/4), 0, 0);
    case tmu6Hour : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, 6*(Time.tm_hour/6), 0, 0);
    case tmu12Hour : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, 12*(Time.tm_hour/12), 0, 0);
    case tmuDay : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, Time.tm_mday, 0, 0, 0);
    case tmuMonth : return TSecTm(Time.tm_year+1900, Time.tm_mon+1, 1, 0, 0, 0);
    case tmuYear : return TSecTm(Time.tm_year+1900, 1, 1, 0, 0, 0);
    case tmuWeek : { int dd=1, mm=1, yy=1;
      // week starts on Thursday, since 1.1.1970 is Thursday
      const int Day = TJulianDate::GetJulianDateN(Time.tm_mday, Time.tm_mon+1, 1900+Time.tm_year);
      TJulianDate::GetCalendarDate(3+7*(Day/7), dd, mm, yy);  return TSecTm(yy, mm, dd, 0, 0, 0); }
    default : Fail;
  }
  return TSecTm();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void TSecTm::Save ( TSOut SOut) const [inline]

Definition at line 103 of file tm.h.

References AbsSecs, and TUInt::Save().

Referenced by TGStat::Save().

{AbsSecs.Save(SOut);}

Here is the call graph for this function:

Here is the caller graph for this function:

void TSecTm::SaveTxt ( TOLx Lx) const

Definition at line 950 of file tm.cpp.

References AbsSecs, IAssert, TInt::Mx, and TOLx::PutInt().

Referenced by TOLx::PutVarSecTm().

                                   {
  IAssert(int(AbsSecs) < TInt::Mx);
  Lx.PutInt((int)AbsSecs);
}

Here is the call graph for this function:

Here is the caller graph for this function:

TSecTm& TSecTm::SubDays ( const int &  Days) [inline]

Definition at line 169 of file tm.h.

References AbsSecs, IAssert, IsDef(), and TUInt::Val.

                                  {
    IAssert(IsDef()); AbsSecs.Val-=uint(Days*24*3600); return *this;}

Here is the call graph for this function:

TSecTm& TSecTm::SubHours ( const int &  Hours) [inline]

Definition at line 165 of file tm.h.

References AbsSecs, IAssert, IsDef(), and TUInt::Val.

                                    {
    IAssert(IsDef()); AbsSecs.Val-=uint(Hours*3600); return *this;}

Here is the call graph for this function:

TSecTm& TSecTm::SubMins ( const int &  Mins) [inline]

Definition at line 161 of file tm.h.

References AbsSecs, IAssert, IsDef(), and TUInt::Val.

                                  {
    IAssert(IsDef()); AbsSecs.Val-=uint(Mins*60); return *this;}

Here is the call graph for this function:

TSecTm& TSecTm::SubSecs ( const int &  Secs) [inline]

Definition at line 157 of file tm.h.

References AbsSecs, IAssert, IsDef(), and TUInt::Val.

                                  {
    IAssert(IsDef()); AbsSecs.Val-=uint(Secs); return *this;}

Here is the call graph for this function:

TSecTm& TSecTm::SubWeeks ( const int &  Weeks) [inline]

Definition at line 173 of file tm.h.

References AbsSecs, IAssert, IsDef(), and TUInt::Val.

                                    {
    IAssert(IsDef()); AbsSecs.Val-=uint(Weeks*7*24*3600); return *this;}

Here is the call graph for this function:

void TSecTm::Undef ( ) [inline]

Definition at line 124 of file tm.h.

References AbsSecs, and TUInt::Mx.


Member Data Documentation


The documentation for this class was generated from the following files: