Contents

date

Creates and returns a new date object set to the current date and time.

Declaration

+ (instancetype) date;

Return Value

A new date object set to the current date and time.

Discussion

This method uses the default initializer method for the class, init().

The following code sample shows how to use date to get the current date:

NSDate *today = [NSDate date];

See Also

Related Documentation

  • Date and Time Programming Guide
  • Property List Programming Guide

Creating a Date