Changeset 2566 in ntrip for trunk/BNC/bnctime.cpp
- Timestamp:
- Aug 11, 2010, 3:11:24 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnctime.cpp
r2257 r2566 113 113 return this->_sec - time1._sec; 114 114 } 115 } 116 117 // 118 ////////////////////////////////////////////////////////////////////////////// 119 void bncTime::civil_date (unsigned int& year, unsigned int& month, 120 unsigned int& day) const { 121 double day_d; 122 long int yy, mm; 123 jmt(_mjd, yy, mm, day_d); 124 year = yy; 125 month = mm; 126 day = static_cast<unsigned int>(day_d); 115 127 } 116 128 … … 166 178 } 167 179 180 // 181 ////////////////////////////////////////////////////////////////////////////// 182 string bncTime::datestr(char sep) const { 183 unsigned int year, month, day; 184 civil_date(year,month,day); 185 ostringstream str; 186 str.setf(ios::fixed); 187 str << setfill('0'); 188 str << setw(4) << year; 189 if (sep) str << sep; 190 str << setw(2) << month; 191 if (sep) str << sep; 192 str << setw(2) << day; 193 return str.str(); 194 } 168 195 169 196 //
Note:
See TracChangeset
for help on using the changeset viewer.