IOS note, ios note

Source: Internet
Author: User
Tags month name

IOS note, ios note

1. NSDateFormatter format:

  • Year
    • yDisplay the year (0-9) as a number without leading zero
    • yyDisplays the year in the format of two digits with leading zeros.
    • yyyDisplay the year in four-digit format
    • yyyyDisplay the year in four-digit format
  • Month

    • MDisplay the month as a number without leading zero (for example, January 1, January is expressed as 1)
    • MMDisplay the month as a number with a leading zero (for example, 01/12/01)
    • MMMDisplay the month as an abbreviation (for example, Jan)
    • MMMMDisplay the month as the complete month name (for example, January)
      • Jan January
      • Feb February
      • Mar March, March
      • Apr April
      • May
      • June Jun June
      • July Jul July
      • Aug August, August
      • Sep September
      • October, October
      • Nov November, November
      • December, December
  • Day

    • dDisplay the day as a number without leading zero (for example, 1)
    • ddDisplay the day as a number with a leading zero (for example, 01)
  • Week
    • EEEDisplay Day as an abbreviation (for example, Sun)
    • EEEEDisplay day as full name (for example, Sunday)
      • Mon Monday
      • Tuesday Tue Tuesday
      • Wed Wednesday
      • Thu Thursday
      • Friday Fri Friday
      • Saturday
      • Sunday Sun
  • Hours
    • hUse the 12-hour system to display the hour as a number without leading zero (for example, 1:15:15)
    • hhDisplay the hour as a number with a leading zero (for example, 01:15:15) in 12-hour format)
    • HUse the 24-hour system to display the hour as a number without leading zero (for example, 1:15:15)
    • HHDisplay the hour as a number with a leading zero (for example, 01:15:15) in the 24-hour format)
  • Minutes
    • mDisplay the minute as a number without leading zero (for example)
    • mmDisplay minutes as numbers with leading zeros (for example, 12:01:15)
  • Seconds
    • sDisplay the second as a number without leading zero (for example)
    • ssDisplay seconds as numbers with leading zeros (for example, 12:15:05)
    • fDisplays the decimal part of a second.
    • ffDisplay to 1% seconds
    • ffffDisplay the data in exactly one thousandth of a second
    • Up to seven f characters can be used in user-defined formats
  • Morning and afternoon
    • t12-hour format
      • An upper-case A is displayed for any hour before noon.
      • An uppercase P value is displayed for any hour between noon and PM.
    • ttFor regions in the 12-hour format
      • The upper-case AM is displayed for any hour before noon.
      • An uppercase PM is displayed for any hour between noon and PM.
    • For regions in the 24-hour format, no characters are displayed.
  • Time Zone
    • zDisplay Time Zone offset without leading zero
    • zzDisplay the time zone offset with leading zero (for example,-08)
    • zzzDisplay the complete time zone offset (for example,-0800)
  • Epoch
    • ggDisplay time/epoch strings (for example, A. D .)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.