You're not actually doing anything with the result of this case statement.  Instead, do it this way.

```erlang
SecondsStale = max(0, LocalTime - LastModified),
````