# sub\_year

Source: https://zotonic.com/docs/1505/sub_year

URI: https://zotonic.com/id/1505

Language: en



Subtracts a year from a date. The value must be of the form `{{Y,M,D},{H,I,S}}`.

For example:

```django
{{ value|sub_year }}
```

When the value is `{{2008,12,10},{15,30,0}}` then the output is `{{2007,12,10},{15,30,0}}`.

The filter has an optional argument which defines the number of years to subtract:

For example:

```django
{{ value|sub_year:3 }}
```

When the value is `{{2008,12,10},{15,30,0}}` then the output is `{{2005,12,10},{15,30,0}}`.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1505?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1505?language=en>)
