~vbursian/research-assistant/intervers

« back to all changes in this revision

Viewing changes to RANet/Time.cpp

  • Committer: Viktor Bursian
  • Date: 2013-06-06 15:10:08 UTC
  • Revision ID: vbursian@gmail.com-20130606151008-6641eh62f0lgx8jt
Tags: version_0.3.0
versionĀ 0.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
};
64
64
 
65
65
 
 
66
sString  sTime::Text () const
 
67
{
 
68
  sString         Txt;
 
69
  long int        h = floor( T/3600000 );
 
70
  long int        m = floor( (T-h*3600000) /60000);
 
71
  long int        s = floor( (T-h*3600000-m*60000) /1000 );
 
72
  long int        ms= floor(  T-h*3600000-m*60000-s*1000 );
 
73
  Txt << Y;
 
74
  Txt += "-";
 
75
  if( M < 10 )  Txt += "0";
 
76
  Txt << M;
 
77
  Txt += "-";
 
78
  if( D < 10 )  Txt += "0";
 
79
  Txt << D;
 
80
  Txt += " ";
 
81
  if( h < 10 )  Txt += "0";
 
82
  Txt << h;
 
83
  Txt += ":";
 
84
  if( m < 10 )  Txt += "0";
 
85
  Txt << m;
 
86
  Txt += ":";
 
87
  if( s < 10 )  Txt += "0";
 
88
  Txt << s;
 
89
  Txt += ".";
 
90
  if( ms < 10 )  Txt += "0";
 
91
  if( ms < 100 )  Txt += "0";
 
92
  Txt << ms;
 
93
  return Txt;
 
94
};
 
95
 
 
96
 
66
97
rsTime  sTime::operator += (real  TimeInterval)
67
98
{
68
99
  T+=Round(TimeInterval*1e3);