Check out our BRAND NEW ISO specification for $138 ONLY! ORDER NOW!!!
-
So I'm making a simple javascript time-interval conversion utility for my app.
-- But cartman, why don't you just use one of the many freely available lib--
-- SHUT UP BITCH I DO WHAT I WANT MAKE ME A SANDWICH!Anyway, everything is chugging along nicely. I wrote the code I needed to get my app going. So I thought: "Why not do something nice and add a little extra? Let's say, a .NET TimeSpan support. Or even better, a support for the official ISO 'duration' format, just to make things more interoperable".
I look into the ISO 8601 specification on Wikipedia. Turns out ISO 8601 duration format is something like
"P3Y6M4DT12H30M5S"
.P
is always at the start ("period").Y
,M
,D
are year, month and day.T
signifies the start of the second ("time") part.H
,M
andS
are what you expect.Auxiliary-WTF, but not TRWTF:
Ok, so let's say I get a string like that and I want to convert it to milliseconds. So I add the number of seconds multiplied by 1000 with number of minutes.... etc... wait... wat?
HOW LONG IS THE MONTH?
30 days, 31 days... what!? What a moronic way to represent the duration!
Unfortunately, stupid wikipedia is silent on the matter. So I have to dig into the specification itself. Probably some stupid PDF with scanned typewritten pages, found deep into the bowels of some governmental site.
Nope.
Ok, the site looks decent enough... and it has a clearly marked section "How can I get ISO 8601?", which is a plus. No need to dig through some FTP.... wait, wat?
You can buy the full standard from the ISO Store, or from the ISO member in your country.
ISO... store? ... buy? ...
Wat?
http://www.iso.org/iso/catalogue_detail?csnumber=40874138 swiss francs... WAT!?
THEY EXPECT ME TO FORK OUT $140 FOR THEIR STUPID 30 PAGE DOCUMENT!?
THEY SHOULD BE THE ONE PAYING ME FOR SUPPORTING THEIR STINKING SPECIFICATION!
I know this is old news for some of you guys, but seriously... wat?
-
Yeah, specs are fucking awful that way. IEEE 829 is not only $141 US but also rediculously over-complex and confusing. They're making a new ISO for SQA that I'm just ignoring entirely.
-
Hmm, how clever of them. They named their organization ISO, so now when I search for their shit on piratebay, I get thousands of .iso linux distros and pirated games.
YOU WON THIS TIME ISO, BUT THERE WILL BE ANOTHER RECKONING!
-
If someone is curious:
2.2.12
month
duration of 28, 29, 30 or 31 calendar days depending on the start and/or the end of the corresponding time
interval within the specific calendar month
NOTE 1 The term βmonthβ applies also to the duration of any time interval which starts at a certain time of day at a
certain calendar day of the calendar month and ends at the same time of day at the same calendar day of the next
calendar month, if it exists. In other cases the ending calendar day has to be agreed on.
NOTE 2 In certain applications a month is considered as a duration of 30 calendar days.Not a big surprise, but I'm still considering printing this out, smearing poo all over the papers, taking a photo and sending it to the ISO headquarters in the grotto of an extinguished volcano. And posting it to pirate bay. Before the poo part.
-
I look into the ISO 8061 specification on Wikipedia.
What the fuck does alpine ski binding release torque have to do with this, anyway?
Also also, 8601 time periods are totally retarded for periods > 30 days which aren't expressed in terms of months (i.e. not "in a month's time")
Filed under: coincidentally, I also have a hooky copy of ISO 8061
-
What the fuck does alpine ski binding release torque have to do with this, anyway?
Also, look here
That's the one I found.
-
Someone should put together a massive collection of ISO documents, organize it and release it via torrent.
This, and a well documented collection of cracks for old software copy protection are projects I'd donate to.
-
They named their organization ISO, so now when I search for their shit on piratebay, I get thousands of .iso linux distros and pirated games.
You know .iso images are called like that because of the ISO 9660 standard, right?
-
Nominated for whoosh
-
Well that's a shitty naming scheme. We'd end up with half of everything named "iso" and the other half named "rfc". Or worse, some meaningless number combination like "802.11".
-
Can we just settle on ".file" for our file extensions? or ".dat" if they contain data?
-
You know .iso images are called like that because of the ISO 9660 standard, right?
What an interesting.... coincidence.
-
Nominated for whoosh
I saw the mistype, I intentionally left it standing.. because... SHUT UP!
-
Iso filetype:pdf
Iso #### in books, ebooks........
I mean, what?
-
Or ".bin"!
-
We need ".program" for programs. ".exe" is too confusing, and Macs don't have it so it doesn't count.
But the real question is whether ".porn" would be for pictures or movies.
-
But the real question is whether ".porn" would be for pictures or movies.
Container format, allows a whole range of codecs, from text-only for stories and ASCII porn to images and videos. Duh.
-
Ok, so let's say I get a string like that and I want to convert it to milliseconds. So I add the number of seconds multiplied by 1000 with number of minutes.... etc... wait... wat?
HOW LONG IS THE MONTH?
30 days, 31 days... what!? What a moronic way to represent the duration!
Not if you're wanting to represent durations in human affairs. When you book something to occur every six months, you're not thinking in terms of an exact number of milliseconds between each, but rather a number of months. You can only convert to an exact number of days by knowing the start date of the period. What's more, you can't convert from days to seconds without knowing what timezone is being used (because of DST) and converting to milliseconds might even require knowing about leap-seconds, depending on the time rules that you're using.
Times and dates are much more complicated than they appear to be at first glance. (Because they're a human thing.) And the correct way to represent period of a million seconds is
PT1000000S
; say what you really mean directly.
-
I'm glad that you know if a file contains a WTF by using the extension .php
-
I'm glad that you know if a file contains a WTF by using the extension .php
I have other files that contain PHP WTFs whose file extensions are not .php. They include .php3, .php4, .php5, .phtml, and .phps under specific conditions.
-
if(strpos(strtolower($extension), 'php') !== false)
-
if(strpos($extension) !== false)
if (strpos($filename, $extension) !== false || strpos($filename, '.phtml') !== false)
-
completely blanked on a couple of things in my last post
-
I see your
strtolower
and raise youstripos
.
-
I think there's a creme for that.
-
-
We need ".program" for programs. ".exe" is too confusing, and Macs don't have it so it doesn't count.
Macs use ".app" which are actually a folder, what's your point?
-
Humor. Yours?
-
Well that's a shitty naming scheme. We'd end up with half of everything named "iso" and the other half named "rfc". Or worse, some meaningless number combination like "802.11".
It's not less arbitrary to remember than any consumer-friendly name like "Wi-Fi" or something (in fact, if you know the IEEE naming standard then it is a little bit easier to remember)
Furthermore naming technology after their standard has the advantage that anyone that says it support that technology must support the standard, altough such a construction is also possible with arbitrary named (e.g. "Wi-Fi certified" which is a trademark which you can only use after standards compliance tests)
-
-
I'd point out the spelling issue (even the English don't add the u there) but I don't really want another spellar badge.
-
I'd point out the spelling issue (even the English don't add the u there) but I don't really want another spellar badge.
Sorrynot really, flagged it anyway. :P
-
Damn. I was hoping to get a pendantic dickweed badge elsewhere and only got two flags, one of which was my own. I don't want another spellar one.
-
Not flagged: trying too hard.
-
I don't normally bother since I figure I'm not nearly pendantic dickweedy enough.
But FFS it's my birthday as of 6 minutes ago so, you know, as a birthday gift, right? @PJH?
(A guy's gotta try, right?)
-
-
I approve of this!
-
Mine's in two days, what are the odds?
(cue link about birthday paradox)
-
I was hoping to get a pendantic dickweed badge elsewhere and only got two flags, one of which was my own. I don't want another spellar one.
FWIW, the spellar/gramming is currently rarer and more special than the bronze pedantic dickweed badge. Four of the latter have been awarded, but only two spellar/gramming, so far.
-
Mine's in two days, what are the odds?
(cue link about birthday paradox)
How about the fact that my sister - that is 11 years younger than me - has her birthday tomorrow?
-
FWIW, the spellar/gramming is currently rarer and more special than the bronze pedantic dickweed badge. Four of the latter have been awarded, but only two spellar/gramming, so far.
With my pendantry with spellar? WTH?!
*shakes fist* DISCOOOOOOOOOOOOOOOOURSE! (as if it's somehow Discourse's fault)
-
With my pendantry with spellar?
Hell, as far as I know, I'm the one who bashed the "pendantry" meme into the collective consciousness of this site, and I haven't earned a badge for it. There ain't no justice!
(I know I didn't make the typo, I just beat it into the ground.)
-
Hell, as far as I know, I'm the one who bashed the "pendantry" meme into the collective consciousness of this site, and I haven't earned a badge for it. There ain't no justice!
(I know I didn't make the typo, I just beat it into the ground.)
I'm sure you'll get there. I aspire to, one day.
-
Sometimes you have no choice but to represent intervals this way. If you make one payment a month, the interval is one month. The interval between Christmases is one year. It's not some particular number of days or number of seconds. It just isn't.
-
-
Nah, if you gotta call it Timelord Badge, @PJH
-
Nah, if you gotta call it Timelord Badge,
I'm talking about this one:
http://what.thedailywtf.com/badges/129/i-m-a-special-snowflake
-
Hmm serves me right using a normal computer to post. Though it's not in Swype auto complete either, closest is humourless. Humorous is in the US keyboard but not the UK one. Normally spelling errors are underlined but not here. Discourse also somehow removes the handle from the insertion point.
Your sister has a birthday on the 1st? Mine too!
-
Want another snowflake instead?
Why not, it is my birthday after all and if I'm not going to get the pendantry badge, I might as well get another snowflake, right?
-
No, my birthday's the first, her's in the second.