Skip to content Skip to sidebar Skip to footer

Why Is This Generating 3913 As The Year

I wrote some code that I am try to use as a comparison for a subscription so this piece of code was supposed to dump the current date. The month and day are correct but the year is

Solution 1:

You are using a deprecated constructor that takes the year - 1900 as its first argument.

Solution 2:

Depending on what you're gonna end up doing with the app, take this with a grain of salt:

Just subtract 1900 from the year and send that to your method or whatever you're doing.

Note: THIS IS A TERRIBLE PROGRAMMING PRACTICE and if this is anything other than self-education, FIND A BETTER WAY.

Post a Comment for "Why Is This Generating 3913 As The Year"