Version: current

# Class Time

Represents a column in the database with the type 'Time'.

  Object
  ViewableData implements IteratorAggregate
  DBField
  Time

Package: sapphire\model
Located at sapphire/core/model/fieldtypes/Time.php

## Methods summary

`public` | # `setValue( mixed $value )` Set the value on the field. Optionally takes the whole record as an argument, to pick other values. Set the value on the field. Optionally takes the whole record as an argument, to pick other values. #### Parameters $value mixed $value #### Overrides `DBField::setValue`
`public string` | # `Nice( )` Return a user friendly format for time in a 12 hour format. Return a user friendly format for time in a 12 hour format. #### Returns `string` Time in 12 hour format
`public string` | # `Nice24( )` Return a user friendly format for time in a 24 hour format. Return a user friendly format for time in a 24 hour format. #### Returns `string` Time in 24 hour format
`public string` | # `Format( string $format )` Return the time using a particular formatting string. Return the time using a particular formatting string. #### Parameters $format string $format Format code string. e.g. "g:ia" #### Returns `string` The date in the requested format
`public` | # `TwelveHour( mixed $parts )`
`public` | # `requireField( )` Add the field to the underlying database. Add the field to the underlying database.
`public `FormField`` | # `scaffoldFormField( string $title = null, mixed $params = null )` Returns a FormField instance used as a default for form scaffolding. Returns a FormField instance used as a default for form scaffolding. Used by `SearchContext`, `ModelAdmin`, `DataObject::scaffoldFormFields()` #### Parameters $title string $title Optional. Localized title of the generated instance $params #### Returns ``FormField`` FormField #### Overrides `DBField::scaffoldFormField`

### Methods inherited from DBField

`ATT()`, `HTML()`, `HTMLATT()`, `JS()`, `LowerCase()`, `RAW()`, `RAWURLATT()`, `URLATT()`, `UpperCase()`, `XML()`, `__construct()`, `addToQuery()`, `create()`, `debug()`, `defaultSearchFilter()`, `exists()`, `forTemplate()`, `getName()`, `getValue()`, `hasValue()`, `nullValue()`, `prepValueForDB()`, `saveInto()`, `scaffoldSearchField()`, `setName()`, `setTable()`, `writeToManipulation()`

### Methods inherited from ViewableData

`ATT_val()`, `BaseHref()`, `CSSClasses()`, `ColumnBreak()`, `ColumnCalc()`, `ColumnNumber()`, `ColumnPad()`, `ColumnPos()`, `CurrentMember()`, `CurrentPage()`, `Debug()`, `Even()`, `EvenOdd()`, `First()`, `FirstLast()`, `HasPerm()`, `IsAjax()`, `JS_val()`, `Last()`, `Me()`, `Middle()`, `MiddleString()`, `Modulus()`, `MultipleOf()`, `Odd()`, `Pos()`, `RAW_val()`, `SQL_val()`, `ThemeDir()`, `ThemeName()`, `Top()`, `TotalItems()`, `XML_val()`, `__get()`, `__isset()`, `__set()`, `buildCastingCache()`, `cachedCall()`, `castingClass()`, `castingHelper()`, `castingHelperPair()`, `castingObjectCreator()`, `castingObjectCreatorPair()`, `customise()`, `defineMethods()`, `escapeTypeForField()`, `getField()`, `getIterator()`, `getSecurityID()`, `getXMLValues()`, `hasField()`, `i18nLocale()`, `iteratorProperties()`, `obj()`, `renderWith()`, `setCustomisedObj()`, `setField()`

### Methods inherited from Object

`__call()`, `__toString()`, `__wakeup()`, `addMethodsFrom()`, `addStaticVars()`, `addWrapperMethod()`, `add_extension()`, `add_static_var()`, `allMethodNames()`, `cacheToFile()`, `cacheToFileWithArgs()`, `clearCache()`, `combined_static()`, `createMethod()`, `create_from_string()`, `extInstance()`, `extend()`, `getCustomClass()`, `getExtensionInstance()`, `getExtensionInstances()`, `get_extensions()`, `get_static()`, `hasExtension()`, `hasMethod()`, `has_extension()`, `invokeWithExtensions()`, `is_a()`, `loadCache()`, `parentClass()`, `parse_class_spec()`, `remove_extension()`, `sanitiseCachename()`, `saveCache()`, `set_stat()`, `set_static()`, `set_uninherited()`, `stat()`, `strong_create()`, `uninherited()`, `uninherited_static()`, `useCustomClass()`

### Magic methods summary

## Properties summary

### Properties inherited from DBField

`$arrayValue`, `$defaultVal`, `$default_search_filter_class`, `$escape_type`, `$name`, `$tableName`, `$value`

### Properties inherited from ViewableData

`$casting`, `$customisedObject`, `$default_cast`, `$failover`, `$iteratorPos`, `$iteratorTotalItems`

### Properties inherited from Object

`$class`, `$extension_instances`, `$extensions`

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -