in reply to Re: The day before a specific date
in thread The day before a specific date

Hello, When I use the exact formula as shown in the first example, it does function but I get dates from 1970. It is unclear to me how to use the string in my script within your example so that I get the results I am looking for. I tried a couple of different ideas, but all have failed me. Clearly I am not understanding what to do or how to make it work in my script. Please bear in mind that at best I am a novice or un-ranked amateur at best, so what seems obvious to you all is surely not clear to me. If it helps you help me, the string in the script that provides the date is $C_dsrd. I cannot figure out how to install it in your process and come up with the correct result. I appreciate your experience, skills and patience.

Replies are listed 'Best First'.
Re^3: The day before a specific date
by Corion (Patriarch) on Jun 01, 2023 at 07:40 UTC

    A good start would be to post the code you have, and examples of the data you want to provide to it. This helps us see much better where you are.

    Ideally you also show the output you get from the code and also the output you expect.

    An example structure could be:

    #!perl use 5.020; use feature 'signatures'; no warnings 'experimental::signatures'; sub day_before( $day ) { # ... } for my $date (@ARGV) { say sprintf "The day before %s is %s", $date, day_before($day); }