Changeset 48

Show
Ignore:
Timestamp:
03/26/06 09:54:26 (6 years ago)
Author:
PeyloW
Message:

Ported part of PostgreSQLs date parsiong to D to suit my needs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/date.d

    r47 r48  
    269269 * will be acceptable. 
    270270 * 
    271  * For example "060310", "Mars 10, 2006", "3/10/06", "2006.069", "J2453805",  
    272  * "Mars 10, 2006", and "2006-mar-10", will all yield the 10th of mars 2006 CE. 
     271 * For example "060310", "March 10, 2006", "3/10/06", "2006.069", "J2453805",  
     272 * and "2006-mar-10", will all yield the 10th of mars 2006 CE. 
    273273 * 
    274274 * Params: 
     
    304304  int y, m, d, yd; 
    305305  assert(d1 == toDate("060310")); 
    306   assert(d1 == toDate("Mars 10, 2006")); 
     306  assert(d1 == toDate("March 10, 2006")); 
    307307  assert(d1 == toDate("3/10/06")); 
    308308  assert(d1 == toDate("2006.069")); 
    309309  assert(d1 == toDate("J2453805")); 
    310   assert(d1 == toDate("Mars 10, 2006")); 
    311310  assert(d1 == toDate("2006-mar-10")); 
    312311   
  • branches/dateparse.d

    r47 r48  
    12071207    specials["january"] = spec(MaskFlag.MONTH, 1); 
    12081208    specials["february"] = spec(MaskFlag.MONTH, 2); 
    1209     specials["mars"] = spec(MaskFlag.MONTH, 3); 
     1209    specials["march"] = spec(MaskFlag.MONTH, 3); 
    12101210    specials["april"] = spec(MaskFlag.MONTH, 4); 
    12111211    specials["may"] = spec(MaskFlag.MONTH, 5);