News for hackers. Stuff that matters.
Re:The Rise of "Logical Punctuation". by jeffool on Friday May 13, 2011 @04:41AM (#2544022)
Now if only ISO 8601 date formatting would catch on... (yyyy-mm-dd)
Re:The Rise of "Logical Punctuation". by furyg3 on Friday May 13, 2011 @04:57AM (#2544039)
Also: 24h time with no timezones.
Re:The Rise of "Logical Punctuation". by run4yourlives on Friday May 13, 2011 @12:16PM (#2545123)
No on the timezone deletion. While I support the ISO Date and 24 hour clock, doing away with timezones adds confusion and accomplishes little.

People generally live their lives within the local sphere. There is a lot said in the phase "My plane lands at Narita at 13:00/1PM" that isn't said in the phrase "My plane lands at Narita at 05:00 GMT".

With the first, I know that the locals are just finishing lunch, it's likely to be the warmest part of the day, and that it'll be busy getting to the hotel, but everything should be open.

Converting everyone to GMT means that every time you leave your region, you need to figure out what time customary activities take place - and you need to do this for every single different place you visit.

Standardized GMT doesn't work unless you are a hermit with no friends or need for communication.

Re:The Rise of "Logical Punctuation". by rimantas on Friday May 13, 2011 @06:19AM (#2544163)
How would that help? Timezones help to coordinate hours with day and night. If you know something happended somewhere at 3a.m. you can assume it was night (unless it was a polar day). Without timezones the task becomes much more difficult.
Re:The Rise of "Logical Punctuation". by furyg3 on Friday May 13, 2011 @07:47AM (#2544291)
I don't know. I think that we're at a point where knowing the absolute time is more important to knowing the relative time (relative to daylight).

If I'm in New York following the nuclear crisis in Japan, it's probably more important for me to know that the next news conference is two hours from now than that it's in "the morning" there. If I'm planning a meeting I certainly want to know the absolute time it's occurring, and only care about the relative time depending on how courteous I am.

I'm not saying we should stop caring about working hours and daylight hours in various places. I'm just saying that those vary wildly and are dynamic, and we should reflect that in our concept of "time".

Re:The Rise of "Logical Punctuation". by roel_v on Friday May 13, 2011 @09:05AM (#2544443)
I disagree. If I make an appointment for a meeting I'm flying to, 5 timezones away, it's better to be able to say 'let's meet at 9am' rather than having to look up what time '2 hours after getting out of bed' is in that particular location. Similarly, if I read news about Japan that says 'an explosion occurred at 10pm' I prefer to know that that means 'after the regular working day' instead of having to look up when the working day ends there.
Re:The Rise of "Logical Punctuation". by personalcompute on Friday May 13, 2011 @01:57PM (#2545501)
Maybe the ideal solution would involve specifying all times in two timezones (local and GMT), side-by-side? Practically, I'm now interested in adding something like a <time> HTML tag that would let users decide how they want to see it, and see it in their own localtime automatically. JQuery plugin anyone?
Re:The Rise of "Logical Punctuation". by landtuna on Friday May 13, 2011 @09:36AM (#2544541)
The real problem I have with everyone using UTC is that the day of the week would change at a time other than midnight.
Re:The Rise of "Logical Punctuation". by billswift on Friday May 13, 2011 @11:13AM (#2544906)
Just keep the day of the week relative to local time; it isn't really important except in local issues anyway.
Re:The Rise of "Logical Punctuation". by JacobAldridge on Friday May 13, 2011 @05:05AM (#2544055)
There was a useful (I found) discussion about no timezones on here a few days ago, when discussing Samoa's decision to switch to the other side of the date line - http://news.ycombinator.com/item?id=2528338
Re:The Rise of "Logical Punctuation". by jeffool on Friday May 13, 2011 @05:04AM (#2544052)
I agree with this. yyyy.mm.dd.hh.mm.ss Also? The Holocene calendar, and the International Fixed Calendar.

But then, I'm a nerd.

Re:The Rise of "Logical Punctuation". by getsat on Friday May 13, 2011 @06:31AM (#2544181)
I say we should stop beating around the bush and just switch to stardates already.
Re:The Rise of "Logical Punctuation". by unwind on Friday May 13, 2011 @05:04AM (#2544050)
Why no timezones? Do you propose that all times always be given as 24-hour UTC?
Re:The Rise of "Logical Punctuation". by furyg3 on Friday May 13, 2011 @07:18AM (#2544248)
Exactly. With international communication on the rise, it's best (IMHO) to do away with the timezone concept, and just use one time format everywhere.

India is +5:30, Nepal is +5:45, California observes DST but Arizona doesn't... the EU does, but they start and end DST a week before the US...

It's ridiculous.

The initial gut reaction against this is that people would hate waking up at 18:00 and going home at 8:00, but I think people would get used to this pretty quickly. After all, we do this twice a year as it is.

Re:The Rise of "Logical Punctuation". by Djehngo on Friday May 13, 2011 @08:12AM (#2544338)
Consider also that there is one hour per year which does not exist and one hour per year which happens twice (at-least within the context of local time if you live in an area with daylight savings)

There is also Namibia which used to lose hours in daylight savings time and Bangladesh which had dst in 2009 then dropped it, this makes historical time calculations tricky.

Re:The Rise of "Logical Punctuation". by bonzoesc on Friday May 13, 2011 @09:11AM (#2544472)
Times should really be given as Miami Internet Beats[1], since it's compatible with everyone in US Eastern and doesn't have antiquated concepts like "hours," or "minutes."

[1]: http://miamibeats.org/

Re:The Rise of "Logical Punctuation". by Derbasti on Friday May 13, 2011 @05:01AM (#2544045)
How about going metric?
Re:The Rise of "Logical Punctuation". by knshaum on Friday May 13, 2011 @07:35PM (#2546642)
Charles Stross does that in his novel Glasshouse: durations are described in kiloseconds, megaseconds, and gigaseconds. (100Ksec is just under 28 hours -- a reasonable proxy for a day -- and 1 Gsec is about 31 years.) In a space-faring society, with no standard astronomical day or year, it made sense.
Re:The Rise of "Logical Punctuation". by henrikschroder on Friday May 13, 2011 @05:30AM (#2544085)
It's the national standard in my country!

(Then again, it's the national standard of two whole countries, everyone else ignores it. :-( )

Re:The Rise of "Logical Punctuation". by rimantas on Friday May 13, 2011 @06:24AM (#2544171)
The same in mine. I had no idea it was so rare :(
Re:The Rise of "Logical Punctuation". by EdiX on Friday May 13, 2011 @07:59AM (#2544317)
One is china, I think. Which is the other one?
Re:The Rise of "Logical Punctuation". by henrikschroder on Friday May 13, 2011 @02:56PM (#2545712)
Last time I checked it was Sweden and Japan. Dunno if more countries have seen the light since. :-)
Re:The Rise of "Logical Punctuation". by angus77 on Friday May 13, 2011 @07:11AM (#2544239)
That's the way it's not only written, but spoken in Japanese.
Re:The Rise of "Logical Punctuation". by Sukotto on Friday May 13, 2011 @10:02AM (#2544631)
Japan uses three different calendars, depending on context.

Imperial / kōki which counts from alleged founding of Japan in 660BC

Era / nengō which counts the years from the start of the Emperor's reign

European / seireki adopting the International standard date counting from the alleged birth date of Jesus Christ

Today is 平成23年5月13日 of Mikado Heisei, the 125th Emperor of Japan

Re:The Rise of "Logical Punctuation". by angus77 on Friday May 13, 2011 @07:45PM (#2546662)
In all three systems, it is both written and spoken year-month-day, which was the point.

Kōki is not used by anyone with a straight face in this day and age.

"Mikado Heisei" is an extremely uncommon way to refer to the emperor. "帝平成" gets 724 hits on Google, and "Mikado Heisei" gets 6, in 5 different languages---the first of which is your post above. Even the Japanese-language wikipedia page on him doesn't use the word "帝" anywhere.

Re:The Rise of "Logical Punctuation". by run4yourlives on Friday May 13, 2011 @12:06PM (#2545090)
Yes please!

I'm sick and tired of people arguing that you put the month first because "That's how you say it".

Re:The Rise of "Logical Punctuation". by hugh3 on Friday May 13, 2011 @01:07PM (#2545314)
Of course you only say it that way in America.

Today is the Thirteenth of May, not May 13.

I prefer dd/mm/yyyy to yyyy/mm/dd though, just to keep what is usually the most important information at the front.

Re:The Rise of "Logical Punctuation". by Pistos2 on Friday May 13, 2011 @01:47PM (#2545471)
I like YYYY-MM-DD for two reasons:

1) Sorting the string representations sorts in time order.

2) It eliminates ambiguity almost completely, because extremely few places use YYYY-DD-MM. The ambiguity of most ##/##/## dates is irritating.

Re:The Rise of "Logical Punctuation". by r00fus on Friday May 13, 2011 @06:28PM (#2546444)
I prefer how we did it in the military: 13MAY2011. mysql: %d%b%Y

No ambiguity, easy to parse and 3-letter month is natural delimiter between day and year numbers.

Re:The Rise of "Logical Punctuation". by run4yourlives on Friday May 13, 2011 @03:32PM (#2545856)
dd-mm-yyyy can easily be confused with mm-dd-yyyy. The only format that is obvious is yyyy-mm-dd.
Re:The Rise of "Logical Punctuation". by hugh3 on Friday May 13, 2011 @03:49PM (#2545928)
Until somebody starts using yyyy-dd-mm and screws everything up.

Besides, often when you write dates you leave the year off entirely.

Re:The Rise of "Logical Punctuation". by dspillett on Friday May 13, 2011 @04:48AM (#2544029)
I'm with you on that.

If only MSSQL Server wasn't broken in the way it interprets that if your user locale is set to UK English (give it a string formatted that way in other locales and the behaviour is as expected, in "English (British)" it sees the format as yyyy-dd-mm).

Re:The Rise of "Logical Punctuation". by eftpotrm on Friday May 13, 2011 @05:02AM (#2544047)
I'm British, I've worked with a large number of clients' SQL Server installs. I think I've only twice seem yyyy-dd-mm as a default behaviour, yyyy-mm-dd was far more common.
Re:The Rise of "Logical Punctuation". by dspillett on Friday May 13, 2011 @06:00AM (#2544129)
I've only seen it assume yyyy-dd-mm when the user's locale is set to "English (British)". In most instances I've come across this setting is just left at the default ("English", which implies "English (American)") even if everything else in the stack is localised for the UK, so the oddity isn't noticed. My build instructions now explicitly state that "English (British)" should not be used due to the way it affects how dates in strings are interpreted when the format NNNN-NN-NN is seen.
Re:The Rise of "Logical Punctuation". by eftpotrm on Friday May 13, 2011 @06:06AM (#2544137)
Odd.

From memory, the safest format to use is actually yyyymmdd (without the hyphens) though, which is apparently supposed to be interpreted unambiguously by SQL Server.

Re:The Rise of "Logical Punctuation". by hessenwolf on Friday May 13, 2011 @06:23AM (#2544168)
Ah, the old 112 instead of 120 format.
Re:The Rise of "Logical Punctuation". by eftpotrm on Friday May 13, 2011 @06:36AM (#2544186)
Y'know, I got so fed up with memorising those numbers at an old job that I built a view that enumerated all the valid ones against GETDATE() :-)
Re:The Rise of "Logical Punctuation". by hessenwolf on Friday May 13, 2011 @06:52AM (#2544204)
I have a formatDate() function lying around somewhere, but I cannot create functions or views on many of the DBs. convert(varchar(8), @myDate, 112) seems a daft way to go about things - and I have been wondering if I have been doing something wrong...
Re:The Rise of "Logical Punctuation". by eftpotrm on Friday May 13, 2011 @07:18AM (#2544249)
Agreed. The CONVERT syntax is rubbish, but the output is so much more powerful. I'd rather have an equivalent of Date.ToString("YYYY-mmm-DD hh:mi:ss.ssss") in SQL but, sadly.... It could be written as a UDF but I'm not sure performance would be up to production use.

I had a wonderful stack of little helper functions and views I'd cobbled together at that job and had had free rein to stick into the real databases; they made development so much easier. The downside of employment though, that sort of work gets stuck with each employer you do it for and can't so easily be carried around like a toolkit.

I experimented a bit with some of the code from http://www.simple-talk.com/community/blogs/philfactor/archiv... a while back on some toy projects; it makes some interesting reading and had me building a few similar functions around my own conventions and rules. On a larger scale, I would be sorely tempted to build something like that into the Model database and insist on a clean output as part of the approval criteria.

Re:The Rise of "Logical Punctuation". by pradocchia on Friday May 13, 2011 @09:49AM (#2544585)
It could be written as a UDF but I'm not sure performance would be up to production use.

If you ever find yourself in that situation again, write the UDF as a in-line table-valued function. You get multiple return values and avoid the scalar UDF hit, since the engine will execute it in-line (appropriately enough).

eg:

select t.date, d.date_as_string from table1 t cross apply dbo.format_date(t.date,'yyyy-mm-dd') d

Re:The Rise of "Logical Punctuation". by pradocchia on Friday May 13, 2011 @09:35AM (#2544534)
yyyymmdd is the only safe format on MSSQL.