Víctor Martín
Víctor Martín

Reputation: 3450

About Integer values

I need to make a variable which store the version of a database, the value will be modified by me everytime I modify the db.

I've been thinking of use the date in format YYYYMMDD, i.e. 20150319. But I don't know if the next values, as 20150320, 20150321... will be bigger.

int database_version = 20150319;

Some mathematics in the room?

Thanks for all.

Upvotes: 0

Views: 63

Answers (1)

RaphMclee
RaphMclee

Reputation: 1623

If the date is written in the correct order (YYYYMMDD), the new dates will always be bigger than the older ones. As time does increase continuously the integer will also increase continuously.

Upvotes: 2

Related Questions