1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Get current date on the phone?

Discussion in 'iPhone/iPad Programming' started by ethana, Jul 21, 2008.

  1. macrumors 6502a

    #1
    Is there an SDK function to easily get the current date on the iPhone? What's the code to do it?

    As a secondary question, is there an easy way to have the date auto-format to the correct country type based off of the iPhones current country settings? Example... US = 07/21/2008, UK = 21.07.2008

    Thanks,

    Ethan
     
  2. macrumors member

    #2
    NSDate Class Reference

    Psuedo Code:
    Code:
    NSDate *now = [[NSDate alloc] init];
    [lblHello setText:[now description]]
    ;

    -Limb
     

Share This Page