title: How to format a SQLite date in iPhone?
body: <p>I know that SQLite doesn't support day name and month name. I have gone through <a href="https://stackoverflow.com/questions/1181123/date-formatting-from-sqlite-query">this</a> question. I have created two custom functions for it.</p>
  
  <p>My custom function for Converting Day name from day number:</p>
  
  <pre><code>( %w day of week 0-6 with sunday==0 )
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>+(NSString*)dayNameStringFromDayNo:(NSString*)dayNo{
      return 
      ([dayNo isEqualToString:@"0"])?@"Sunday":
      ( ([dayNo isEqualToString:@"1"])?@"Monday":
       ( ([dayNo isEqualToString:@"2"])?@"Tuesday":
        ( ([dayNo isEqualToString:@"3"])?@"Wednesday":
         ( ([dayNo isEqualToString:@"4"])?@"Thursday":
          ( ([dayNo isEqualToString:@"5"])?@"Friday": @"Saturday"
          )
         )
        )
       )
      );
  }
  </code></pre>
  
  <p>My custom method for getting month name from month no string:</p>
  
  <pre><code>( %m month: 01-12 )
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>+(NSString*)monthNameFromNumber:(NSString*)no{
      return ([no isEqualToString:@"01"])?@"January":
      ( ([no isEqualToString:@"02"])?@"February":
       ( ([no isEqualToString:@"03"])?@"March":
        ( ([no isEqualToString:@"04"])?@"April":
         ( ([no isEqualToString:@"05"])?@"May":
          ( ([no isEqualToString:@"06"])?@"June":
           ( ([no isEqualToString:@"07"])?@"July":
            ( ([no isEqualToString:@"08"])?@"August":
             ( ([no isEqualToString:@"09"])?@"September":
              ( ([no isEqualToString:@"10"])?@"October":
               ( ([no isEqualToString:@"11"])?@"November":@"Decemeber"
               )
              )
             )              
            )
           )
          )
         )
        )
       )
      );
  }
  </code></pre>
  
  <p>But what about date following format</p>
  
  <pre><code>Sat 6th February
  </code></pre>
  
  <p>How to get this kind of output ? Do I have to again create a custom function for it ?</p>