cakephp-2.0 > FormHelper :: dateTime()
A AbstractTransport AclBehavior AclComponent AclInterface AclNode AclShell Aco AcoAction ActionsAuthorize ApcEngine ApiShell App AppController AppController AppHelper AppHelper AppModel AppModel AppShell Aro AuthComponent B BadRequestException BakeShell BakeTask BaseAuthenticate BaseAuthorize BasicAuthenticate BasicAuthentication BehaviorCollection C Cache CacheEngine CacheException CacheHelper CacheSession CakeEmail CakeErrorController CakeException CakeLog CakeLogException CakeLogInterface CakePlugin CakeRequest CakeResponse CakeRoute CakeSchema CakeSession CakeSessionException CakeSessionHandlerInterface CakeSocket ClassRegistry CommandListShell Component ComponentCollection ConfigReaderInterface Configure ConfigureException ConnectionManager ConsoleErrorHandler ConsoleException ConsoleInput ConsoleInputArgument ConsoleInputOption ConsoleInputSubcommand ConsoleOptionParser ConsoleOutput ConsoleShell ContainableBehavior Controller ControllerAuthorize ControllerTask CookieComponent CrudAuthorize D DatabaseSession DataSource DbAcl DbAclSchema DbConfigTask DboSource Debugger DebugTransport DigestAuthenticate DigestAuthentication Dispatcher E EmailComponent ErrorHandler ExceptionRenderer ExtractTask F File FileEngine FileLog FixtureTask Folder ForbiddenException FormAuthenticate FormHelper H Helper HelperCollection HelpFormatter HtmlHelper HttpException HttpResponse HttpSocket I I18n I18nModel i18nSchema I18nShell Inflector IniReader InternalErrorException J JqueryEngineHelper JsBaseEngineHelper JsHelper L L10n M MailTransport MediaView MemcacheEngine MethodNotAllowedException MissingActionException MissingBehaviorException MissingComponentException MissingConnectionException MissingControllerException MissingDatabaseException MissingDatasourceConfigException MissingDatasourceException MissingHelperException MissingLayoutException MissingModelException MissingPluginException MissingShellException MissingShellMethodException MissingTableException MissingTaskException MissingTestLoaderException MissingViewException Model ModelBehavior ModelTask MootoolsEngineHelper Multibyte Mysql N NotFoundException NumberHelper O Object ObjectCollection P PagesController PagesController PaginatorComponent PaginatorHelper Permission PhpReader PluginShortRoute PluginTask Postgres PrivateActionException ProjectTask PrototypeEngineHelper R RedirectRoute RequestHandlerComponent Router RouterException RssHelper S Sanitize Scaffold ScaffoldView SchemaShell Security SecurityComponent SessionComponent SessionHelper SessionsSchema Set Shell ShellDispatcher SmtpTransport SocketException Sqlite Sqlserver String T TaskCollection TemplateTask TestsuiteShell TestTask TextHelper ThemeView TimeHelper TranslateBehavior TreeBehavior U UnauthorizedException UpgradeShell V Validation View ViewTask W WincacheEngine X XcacheEngine Xml XmlException

dateTime

line:2134 at /lib/Cake/View/Helper/FormHelper.php
Returns a set of SELECT elements for a full datetime setup: day, month and year, and then time.

Method

(string) public dateTime ($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $attributes = array())

Parameters

ParameterTypeCommentDefault
$fieldName string required Prefix name for the SELECT element
$dateFormat string optional DMY, MDY, YMD. 'DMY'
$timeFormat string optional 12, 24. '12'
$attributes string optional array of Attributes array()

Return

string

Comment

Returns a set of SELECT elements for a full datetime setup: day, month and year, and then time.

### Attributes:

- `monthNames` If false, 2 digit numbers will be used instead of text.
If a array, the given array will be used.
- `minYear` The lowest year to use in the year select
- `maxYear` The maximum year to use in the year select
- `interval` The interval for the minutes select. Defaults to 1
- `separator` The contents of the string between select elements. Defaults to '-'
- `empty` - If true, the empty select option is shown. If a string,
that string is displayed as the empty element.
- `value` | `default` The default value to be used by the input. A value in `$this->data`
matching the field name will override this value. If no default is provided `time()` will be used.

@param string $fieldName Prefix name for the SELECT element
@param string $dateFormat DMY, MDY, YMD.
@param string $timeFormat 12, 24.
@param string $attributes array of Attributes
@return string Generated set of select boxes for the date and time formats chosen.
@link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::dateTime