Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > to get local Date...

Reply
Thread Tools

to get local Date...

 
 
Nigel Wade
Guest
Posts: n/a
 
      03-18-2008
Roedy Green wrote:

> On Tue, 18 Mar 2008 11:57:12 +0000, Nigel Wade <(E-Mail Removed)>
> wrote, quoted or indirectly quoted someone who said :
>
>>That would be American format, we English prefer our dates in sequential order
>>rather than inside-out order.

>
> ISO dates are yyyy-mm-dd
>
> Given that almost everything you write now adays could potentially be
> read by people anywhere in the world, it seems to me we would should
> be avoiding national date formats and using ISO.
>
> National dates in isolation are ambiguous.


Indeed. Trying to decide exactly what is meant by a date of the format 2/3/2008
is a big problem. Good software will use the locale, bad software will hardcode
the programmer's idea of the locale. But which did any particular piece of
software actually use?

One of the worst culprits I have to deal with is Veritas NetBackup, a rather
expensive enterprise backup system. Because it's American software all dates
are output in US format, even though the GUI interface is written in Java. It
must have taken them more work to hardcode the output format specifiers to US
than it would have done to use a Locale and its date formatters.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : http://www.velocityreviews.com/forums/(E-Mail Removed)
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
 
Reply With Quote
 
 
 
 
Dr J R Stockton
Guest
Posts: n/a
 
      03-19-2008
In comp.lang.java.programmer message <0jovt3hlq7vmvt8otii5gelhag8u8hiefu
@4ax.com>, Tue, 18 Mar 2008 15:43:04, Roedy Green <see_website@mindprod.
com.invalid> posted:

>National dates in isolation are ambiguous. They might be dd-mm or
>mm-dd. ISO date format thankfully is still unambiguous.


If one knows the string to be an ISO date, it is unambiguous. Extended
format - yyyy-mm-dd - could be an arithmetic expression. And it should
not be assumed that a date such as 20080305 is ISO Basic format (try
Google for that string).

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
 
Reply With Quote
 
 
 
 
Dr J R Stockton
Guest
Posts: n/a
 
      03-19-2008
In comp.lang.java.programmer message <froonh$ang$(E-Mail Removed)>,
Tue, 18 Mar 2008 15:56:33, Nigel Wade <(E-Mail Removed)> posted:

>Indeed. Trying to decide exactly what is meant by a date of the format 2/3/2008
>is a big problem. Good software will use the locale, bad software will hardcode
>the programmer's idea of the locale.


Good software will use either the locale or the ISO form for human I/O.

But, for communicating with other systems elsewhere, good software will
use a fixed, agreed, and preferably ISO format.

Nowadays, too, a single locale may not suit a given user (Locale was
probably introduced on the basis that people all use the same system
mm/dd/yy hh:mm am, except for foreigners).

But, hereabouts, while almost everyone uses GMT in winter and BST in
summer, hence the "proper" chronological locale, a very large proportion
would probably prefer Korean locale otherwise.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk BP7, Delphi 3 & 2006.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htm> clpdmFAQ;
<URL:http://www.borland.com/newsgroups/guide.html> news:borland.* Guidelines
 
Reply With Quote
 
Dr J R Stockton
Guest
Posts: n/a
 
      03-20-2008
In comp.lang.java.programmer message <(E-Mail Removed)
on.merlyn.invalid>, Wed, 19 Mar 2008 18:13:59, Dr J R Stockton
<(E-Mail Removed)> posted:
>In comp.lang.java.programmer message <0jovt3hlq7vmvt8otii5gelhag8u8hiefu
>@4ax.com>, Tue, 18 Mar 2008 15:43:04, Roedy Green <see_website@mindprod.
>com.invalid> posted:
>
>>National dates in isolation are ambiguous. They might be dd-mm or
>>mm-dd. ISO date format thankfully is still unambiguous.

>
>If one knows the string to be an ISO date, it is unambiguous. Extended
>format - yyyy-mm-dd - could be an arithmetic expression. And it should
>not be assumed that a date such as 20080305 is ISO Basic format (try
>Google for that string).


Oops : I meant to write "for YYYYDDMM".

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
get local and domain members from local group? andres ASP .Net 1 10-23-2007 08:46 AM
.NET 2.0: Sending email on local domain to local exchange 2K server Jim in Arizona ASP .Net 8 01-24-2006 05:37 PM
Access local port or Running local exe file =?Utf-8?B?WVNVVA==?= ASP .Net 0 01-14-2006 12:41 AM
Can't use 'local' to find sql server instances on local machine karim ASP .Net 1 06-26-2003 09:17 PM



Advertisments