Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 775159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:14:44+00:00 2026-05-14T19:14:44+00:00

I know that SQLite doesn’t support day name and month name. I have gone

  • 0

I know that SQLite doesn’t support day name and month name. I have gone through this question. I have created two custom functions for it.

My custom function for Converting Day name from day number:

( %w day of week 0-6 with sunday==0 )

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"
        )
       )
      )
     )
    );
}

My custom method for getting month name from month no string:

( %m month: 01-12 )

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"
             )
            )
           )              
          )
         )
        )
       )
      )
     )
    );
}

But what about date following format

Sat 6th February

How to get this kind of output ? Do I have to again create a custom function for it ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:14:45+00:00Added an answer on May 14, 2026 at 7:14 pm

    What date format are you getting from SQLite? SQLite does not have a native date/time datatype, but it’s common to store a date as an ISO8601 string of the form YYYY-MM-DD HH:MM:SS or a Unix-style timestamp.

    Step 1: Get the date as an NSDate. Here’s one way, using the ISO8601 format mentioned above:

    // Create a date formatter
    NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init];
    [inputFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    
    // Use the formatter to convert the string you retrieved (from
    // SQLite) into an NSDate.
    NSDate *theDate = [inputFormatter dateFromString:yourSQLiteString];
    
    // Don't forget to release alloc'ed resources
    [inputFormatter release];
    

    If your date was stored as a Unix-style timestamp, you could skip using an input formatter and use NSDate dateWithTimeIntervalSince1970: instead.

    Step 2: Convert the date to a string:

    // Create a date formatter for whatever format you want to output,
    // using the formatting patterns from Unicode tr35-6 Appendix F.
    outputFormatter = [[NSDateFormatter alloc] init];
    [outputFormatter setDateFormat:@"EEE d MMMM"];
    NSString *dateString = [dateFormatter stringFromDate:theDate];
    
    // Don't forget to release alloc'ed resources.
    [outputFormatter release];
    

    In this example you’ll get a string like Sat 6 February, assuming the user is in an English locale.

    References:

    • Data Formatting Programming Guide for Cocoa: Date Formatters
    • Unicode Standard UTS #35: Appendix F: Date Format Patterns
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is a frequently asked question, however none of the solutions that
I really dont know why people use sqlite. As i just gone through some
I have two python scripts that have to run simultaneously because they interact with
I have problems with my coredata sqlite DB, which hosts a book DB. After
I'm writing a program in Ruby that downloads a file from an RSS feed
I'm using Python/SQLite for accessing database. After running the query, and getting the result,
I am used to post my ideas on one forum and started to worry
I want to bulk insert about 700 records into the Android database on my
I am using iTunes file sharing in my app, and need to put Core
is it possible to use the logparser commandline utility to output sql statements as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.