-unsigned long long current_time() {
- unsigned long long rc = 0;
- time_t now_tt = time( 0 );
- tm *now = localtime( &now_tt );
- rc += ( now->tm_year + 1900ULL ) * 10000000000ULL;
- rc += ( now->tm_mon + 1ULL ) * 100000000ULL;
- rc += now->tm_mday * 1000000ULL;
- rc += now->tm_hour * 10000ULL;
- rc += now->tm_min * 100ULL;
- rc += now->tm_sec;
-
- return rc;
+unsigned long long read_time( istream &i ) {
+ string date_string;
+
+ int c;
+ // Todo, don't use char_traits<char> directly here
+ for( c = i.get(); 0 != c && char_traits<char>::eof() != c; c = i.get() ) {
+ date_string.push_back( c );
+ }
+ if( char_traits<char>::eof() == c ) { i.setstate( ios_base::eofbit ); }
+
+ return atoll( date_string.c_str() );