7 ms·
Here's some more information: The year number of the ISO week very often differs from the Gregorian year number for dates close to 1 January. For example, 29 D
by reverend_gonzo 12y ago
Here's some more information:
The year number of the ISO week very often differs from the Gregorian year number for dates close to 1 January. For example, 29 December 2014 is ISO 2015-W1-1, i.e., it is in year 2015 instead of 2014.
http://en.wikipedia.org/wiki/ISO_week_date http://en.wikipedia.org/wiki/ISO_week_date
Specifically, you should be using +%Y instead of +%G when passed into date, and 'yyyy' instead of 'YYYY' when used in Java.
- pyre 12y agoI don't think that %F is what you're looking for: ➜ date +%F 2014-12-29 ➜ date +%G 2015 ➜ date +%Y 2014
- reverend_gonzo 12y agoRight, fixed. Thanks.
- danielweber 12y agoI always wondered "who in the world uses that stuff?" when I read date library docs. Now I know. I also remember at one startup when I asked the payroll guy how many pay periods there were that year, he scoffed "26, it's always 26." Well, not with years having fractionally more than 26 ^H^H^H 52 weeks there aren't.
- nirvdrum 12y agoEvery year has more than 26 weeks ;-) But to your point, I suspect that's why a lot of companies have switched to semi-monthly payroll. It's always 24 pay periods but the pay date itself can shift.
- danielweber 12y agoEnglish is weird. I meant "it's not true that there are 26 pay periods every year, because years have more than 52 weeks, which means there must be a 'leap pay-period'" every once in a while." But your interpretation was entirely valid based on the way I typed mine.
- brlewis 12y agoI think the gp was referring to "years having fractionally more than 26 weeks".
- danielweber 12y agooops!
- paulschreiber 12y agoCalifornia law requires that you be paid every two weeks.
- jlmorton 12y agoNope - It requires that you be paid at least twice per month. http://www.dir.ca.gov/dlse/faq_paydays.htm http://www.dir.ca.gov/dlse/faq_paydays.htm
- jsprogrammer 12y agoMy wife works for a UC school and they post-pay on the 1st of each month. I've skimmed the article you've posted and it would seem that such an arrangement is not allowed. Do you know how they get away with this, or have any other insight?
- brianwawok 12y agoSchools are sometimes treated more like a government entity and exempt from certain rules and taxes like FICA, right? That is my only guess...
- porpoisemonkey 12y agoTeachers are exempt from this rule. From here: http://www.dir.ca.gov/dlse/Glossary.asp?Button1=P#professional%20exemption http://www.dir.ca.gov/dlse/Glossary.asp?Button1=P#profession... professional exemption A person employed in a professional capacity means any employee who meets all of the following requirements: Who is licensed or certified by the State of California and is primarily engaged in the practice of one of the following recognized professions: law, medicine, dentistry, optometry, architecture, engineering, teaching, or accounting, or
- tlrobinson 12y agoWhy are those professions exempt?
- IgorPartola 12y agoThis is exactly why we should adopt a 13 month calendar, with a Year Day as the last day of the year. If it's a leap year, there'd be two consecutive Year Days. These days should be special: they are holidays, so everyone has them off. This immediately solves the payroll problem for most people: just don't pay them for this day (obviously adjusting the numbers such that if you make $60,000/year, you still get that). For those who work on this day (medical professionals, etc.) the rate is different (being a holiday and all), so they just get paid by the hour, regardless of what they do throughout the year. Your payroll can now be weekly, biweekly, monthly, or whatever you want: you still get the same amount of money per month. This is nice because you don't get weirdness with things like rent/mortgage payments which are monthly. For example, for those who get paid biweekly, you get two months a year where you get an extra payment. This is silly and leads to more difficult accounting and budgeting. Monthly is nice, but lots of your expenses are likely one a week-by-week basis: groceries, entertainment, etc. Weekly is AFAIAC the nicest: it is the easiest to budget because it's as close to the common denominator as possible. However, it is not the LCD, so it still has the weird problem of getting more money in some months vs others.
- jxf 12y agoIt'd be pretty tough to retrofit "a day that doesn't belong to any month" into existing computer systems.
- saalweachter 12y agoYes, but ... most existing computer systems are subtly broken for date/time in different ways anyway. Leap days, leap seconds, daylight savings shifts, timezones in general, the above mentioned "year of the week". You'd be substituting a certain number of "this is subtly broken" bugs for a certain number of "this is obviously not implemented correctly" bugs.
- jrochkind1 12y agoI like the idea of a day that everyone has off, but I'm not sure you realize how drastic a change that would be. NO places of business open, no gas stations, no drug stores, no hospitals, no toll collectors, no trains, plains, or mass transit -- no police or firemen? Of course, changing the calendar isn't a realistic plan anyway (Americans still won't accept the freaking metric system, that's too much change! and of course there would be costs to having a calendar different than the rest of the world, unless we get EVERYONE to change). But making _everyone_ have off is even less realistic. So payroll systems would still probably need to account for the days. But I do like the idea of a day or two that literally everyone has off, and would subscribe to your newsletter.
- chrismcb 12y agoEven in years that have fractionally more than 52 weeks, there is still only 26 pay periods. You only get 27 pay periods when the fractions add up, which may or nit be in a leap year.
- smackfu 12y agoYeah, it happens every year, unless the 31st falls on the last day of the week. Also, the 'Y' character was a relatively late addition to Java, in v1.7. Before that it was an invalid value.