Unset “Daylight Savings Time” flag for Gregorian date input#15
Unset “Daylight Savings Time” flag for Gregorian date input#15meighti wants to merge 1 commit intoashkang:masterfrom
Conversation
|
Do you think it would be useful to have a test case for this as well? |
|
Specifically, this command: should give: |
|
It is easy to write a simple test in bash , like the e.g. I mentioned in previous comment. Also in my opinion, it would have been safe to set: to avoid any DST flag issues. |
|
I understand. I was suggesting to add a test in the test suite of the library but I cannot find any set of tests. There are only some commands to help test the library manually. |
1e3173a to
4a4ee3a
Compare
|
Amended my first commit, since further examination showed that contrary to my initial assumption, that one-liner didn't fix the issue. So I had to make a more conservative set of changes, in order to be completely sure that the amended solution gives a correct answer. Hopefully it is now fixed! 🤞 |
|
As for 183amir's suggestion of having a test suite, I can only say at the moment that it would be welcomed if anybody has the time and desire to write one. |
Make sure the daylight savings time flag is NOT set and the time zone is set to “UTC”, otherwise the conversion of a Gregorian date to Jalali form and vice versa in some cases could be one day off.
Make sure “Daylight Savings Time” flag is NOT set,
otherwise the conversion of a gregorian date to
jalali form would be one day off.
As a test try this command:
jdate '+%Y/%m/%d' -j 2018/03/22
The result should be:
1397/01/02