Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discourage using date for versionCode #14

Open
AndroidGecko opened this issue Jul 30, 2015 · 3 comments
Open

discourage using date for versionCode #14

AndroidGecko opened this issue Jul 30, 2015 · 3 comments

Comments

@AndroidGecko
Copy link

versionCode is an int, it will cause problems in 2022

@moallemi
Copy link
Owner

What do you recommend? currently date format is year|month|day|hour|minutes. I have used hour and minutes so it can cover releasing more than one version in a day and because of this the versoinCode is so long. Do you think year|month|day is enough for building versoinCode?

@AndroidGecko
Copy link
Author

@moallemi year|month|day would be unsufficient since on CI with auto deplyment to play store this value needs to be different on each build. In that case build-id from CI is best option as versionCode. It is worth mentioning since many peopel think versionCode is a long value.

@MitchellMcCluskey
Copy link

it will cause problems in 2022

This is not the case. This will function until the end of 2035. The integer is calculated here
return Integer.parseInt(formatter.format(new Date())) - 1400000000;.

This means that is takes year|month|day|hour|minutes and minuses everything from before 2014, doing so will mean that the last date that will be under the max int limit (2147483647) will be 3512312359.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants