You mean you declared a parameter in dateDetails() and declared a Date variable, which you passed to that method and you aren't doing anything with there. Please confirm you are posting the real code you are using rather than writing it anew. In which case, print out that date and work out why it reads 1st January 1970.
Zara bailey wrote:. . . I have declared the parameter and called the argument in main. . . . .
Seriously? That's what you're going with? I prefer this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your databasehttps://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database