Changeset 494


Ignore:
Timestamp:
10/03/14 15:00:19 (10 years ago)
Author:
ymipsl
Message:

Problem when date is up to 9999 year. It solve the ticket #49 issue.
YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/date.cpp

    r431 r494  
    6060         std::streamsize s ;  
    6161         char c ; 
    62           
    63          s = out.width (4);  c = out.fill ('0') ; out << date.year << '-'; 
     62 
     63 
     64         int width=4 ; 
     65         double maxSize=10000 ; 
     66         while(date.year>=maxSize) 
     67         { 
     68           maxSize*=10 ; 
     69           width++ ; 
     70         } 
     71         s = out.width (width);  c = out.fill ('0') ; out << date.year << '-'; 
     72 
    6473         s = out.width (2);  c = out.fill ('0') ; out << date.month << '-'; 
    6574         s = out.width (2);  c = out.fill ('0') ; out << date.day << ' '; 
Note: See TracChangeset for help on using the changeset viewer.