# DSP.jl Side Effect on Dates

**URL:** <https://discourse.julialang.org/t/dsp-jl-side-effect-on-dates/77115>\
**Category:** General Usage\
**Created:** [February 26, 2022, 10:12am UTC](https://discourse.julialang.org/t/dsp-jl-side-effect-on-dates/77115 "2022-02-26T10:12:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![herm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/herm/32/14268_2.png) [@herm](https://discourse.julialang.org/u/herm)\
**Post date:** [February 26, 2022, 10:12am UTC](https://discourse.julialang.org/t/dsp-jl-side-effect-on-dates/77115/1 "2022-02-26T10:12:31Z")

</div>

Interestingly I found with Julia Version 1.7.2 (2022-02-06) for window the following side effect:

No Bug  
using Dates  
datenow=Dates.format(Dates.now(),“yyyymmddTHHMMSSZ”)

Buggy  
using DSP  
using Dates  
datenow=Dates.format(Dates.now(),“yyyymmddTHHMMSSZ”)

Returns:  
ERROR: type DateTime has no field zone

Note that the same effect is obtained by loading just one of the DSP module  
#using DSP  
include(“remez\_fir.jl”)  
using Dates  
datenow=Dates.format(Dates.now(),“yyyymmddTHHMMSSZ”)

Interesting but not too interesting…

---

<div class="post-metadata">

**Author:** ![eliascarv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eliascarv/32/22152_2.png) [@eliascarv](https://discourse.julialang.org/u/eliascarv)\
**Post date:** [February 26, 2022, 11:44am UTC](https://discourse.julialang.org/t/dsp-jl-side-effect-on-dates/77115/2 "2022-02-26T11:44:30Z")

</div>

Examining the Dates.jl and DSP.jl code I found the reason for this error.  
It’s because one of the DSP.jl indirect dependencies is TimeZones.jl. TimeZones.jl uses the strings “Z” and “z” to create objects of type ZonedDateTime:  
[https://juliatime.github.io/TimeZones.jl/stable/conversions/#Parsing-strings-1](https://juliatime.github.io/TimeZones.jl/stable/conversions/#Parsing-strings-1)

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [February 26, 2022, 2:29pm UTC](https://discourse.julialang.org/t/dsp-jl-side-effect-on-dates/77115/3 "2022-02-26T14:29:04Z")

</div>

I would recommend that you _always_ escape letters that you don’t want to be substituted as part of the formatting with `\`. For example:

```julia
fmt = dateformat"yyyymmdd\THHMMSS\Z"
Dates.format(Dates.now(), fmt)

```

where, regardless if some package adds a meaning for `T` and `Z`, you will get the expected output.
