Menu

## ToStringFormat

ToStringFormat.php : 24

Trait ToStringFormat.

Handle global format customization for string cast of the object.

### Table of Contents

#### Methods

resetToStringFormat() : void
  Reset the format used to the default when type juggling a Carbon instance to a string
setToStringFormat() : void

### Methods

#### resetToStringFormat()

ToStringFormat.php : 31

Reset the format used to the default when type juggling a Carbon instance to a string

`public static resetToStringFormat() : void`

#### setToStringFormat()

ToStringFormat.php : 48
`public static setToStringFormat(string|Closure|null $format) : void`

##### Parameters

$format : string|Closure|null

##### Tags

deprecated

  To avoid conflict between different third-party libraries, static setters should not be used. You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and use other method or custom format passed to format() method if you need to dump another string format.

  Set the default format used when type juggling a Carbon instance to a string.

## Search results