$aleOrigin

Date and Time

Please consider subscribing to Mobile Developer Tips
RSS feed or following us on Twitter


How Many Days Are In The Current Month

If you ever need to determine how many days are in the current month, here are a few lines of code to get you there. Calling the rangeOfUnit method in the NSCalendar object, you specify both a small and large calendar units. In this case, a day unit within a month unit. With that information [...]

Date and Time

Date Formatter Examples – Take 4: Setting Locale

A reader recently wrote and asked how to show a date output in a different language. By default, the NSDateFormatter will use the locale set on the device, so no code specific locale changes are required if you want your app to display in the current locale. However, if you need to display a date [...]

Cocoa, Date and Time

Determining Elapsed Time

I recently wrote a short block of code to display an activity indicator while waiting for an image to be written to the iPhone camera roll. The problem I ran into is that the time to write the image file varies, depending on the image size. In some cases the activity indicator would be visible [...]

Date and Time

Date Formatter Examples – Take 3: Date from String

While working on an iPhone application recently, I needed to convert a date read from an XML stream that was in the following format: 20081122 to a nicely formatted string for display on the device: Saturday November 22, 2008.

Cocoa, Date and Time

Date Formatter Examples – Take 2: Format Strings

In the first post on working with dates several of the examples use the “old style” date format syntax. The examples work, however, I want to show an additional example that uses the ICU (International Components for Unicode) library for format strings.

Cocoa, Date and Time

Date Formatter Examples – Take 1: NSDateFormatter

Sometimes all you’re really looking for is a basic chunk of code to get something done. For example, I was working on an application yesterday and needed to display the current date in text format: October 29, 2008. A simple concept for sure, however, with the many nuances of date formatters, it takes some time [...]

Cocoa, Date and Time
All Content Copyright © 2008-2012 • Mobile Developer Tips, All Rights Reserved.
iPhone and iPad are registered trademarks of Apple, Inc.
iOS is a registered trademark of Cisco Technology, Inc.