title: Spring boot 2 Converting Duration java 8 application.properties
body: <p>I need to define <strong>Duration</strong> value <strong>(spring.redis.timeout)</strong> by application.properties.</p>
  
  <p>I was trying to use one point defined in <strong>Spring boot documentation</strong>:</p>
  
  <p><strong>Spring Boot has dedicated support for expressing durations</strong>. If you expose a <code>java.time.Duration</code> property, the following formats in application properties are available:</p>
  
  <p>A regular long representation (using milliseconds as the default unit unless a <code>@DurationUnit</code> has been specified)
  The standard ISO-8601 format used by <code>java.util.Duration</code>
  A more readable format where the value and the unit are coupled (e.g. 10s means 10 seconds)</p>
  
  <p>When i use spring.redis.timeout=3s Spring boot application throws this exception:</p>
  
  <blockquote>
    <p>Cannot convert value of type 'java.lang.String' to required type
    'java.time.Duration': no matching editors or conversion strategy found</p>
  </blockquote>
  
  <p>Which would it be the best way to set a correct value to a Duration property in application.properties withs last Spring boot 2 release?</p>