The year * 10000 + month * 100 + day monotone?
source link: https://www.codesd.com/item/the-year-10000-month-100-day-monotone.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
The year * 10000 + month * 100 + day monotone?
Simple question: is year * 10000 + month * 100 + day
always increasing? For example, today would is 20121011 and tomorrow is 20121012, which is 1 higher. Is this always the case? I've heard of some crazy stuff happening with dates and times before, but I'm no expert.
And just to preempt some responses - I know this is far from the best way to be handling dates/times. I can't use proper libraries for the problem I'm working on without jumping through some serious hoops, and I'd prefer a simple solution.
Yes it must. 0<day<100
and 0<month<100
always. Provided you use the full year, e.g. 2012 and not 12.
And you should not compare times from different zones, then you're fine.
Related Articles
convert the day number into the year in month / day format
Conversion of the date to this format: & ldquo; X years, X months, X days & hellip; & rdquo;
SQL Selecting records that match the year and month between dates
SQL: Try to extract the year and month from a date
How to cut the year and month from the file name
MySQL Select the first day of the year and month
PHP - How to get a year, a month, a day string from the time
Create the Date object for a year, a month, a day, and other
How does the best year store, month and day in a MySQL database?
Android: How to add and display the current date with 100 days from the selected date
SQL Server: Convert ((int) year, (int) month, (int) day) to Datetime
get a year, a month, a day and time form & ldquo; Tue, Jan 12, 2016 09:40:07 GMT & rdquo; in Java / Android
The Hibernate request date is only for the year and month
How to sort the year and month fields in the same row from the mysql table using php
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK