Home All Groups Group Topic Archive Search About

Time formatting is strange

Author
25 Nov 2007 7:17 PM
christery
Anyone got a clue to why ther is a T between date and time in the
"formatted for sorting" or whatewer they call it, and a Z at the end
after seconds- got it fixed for my cobol programmer by formatting it
with yyyy ... aso, made the mistake with mm and MM but got it befre
someone saw) but really think its strange, excel dosent like that
format either. M$ not m$ compatible?

Not a problem for me at the moment, just itrested if im missing
somethng useful.

//CY

Author
25 Nov 2007 7:28 PM
Lasse_Vågsæther_Karlsen
christ***@gmail.com wrote:
> Anyone got a clue to why ther is a T between date and time in the
> "formatted for sorting" or whatewer they call it, and a Z at the end
> after seconds- got it fixed for my cobol programmer by formatting it
> with yyyy ... aso, made the mistake with mm and MM but got it befre
> someone saw) but really think its strange, excel dosent like that
> format either. M$ not m$ compatible?
>
> Not a problem for me at the moment, just itrested if im missing
> somethng useful.
>
> //CY

If the format is for sorting, then it is for sorting, nothing else. It
doesn't have to be compatible with anything other than other values in
the same format.

The format you saw included T for time and Z for zone information.

If you need to create a string that Excel understands as a Date/Time
value, pick a format that Excel understands and format for it using the
ToString method and providing a list of format codes like the mm and MM
you've discovered.

An lastly, it's spelled Microsoft, not M$.

--
Lasse Vågsæther Karlsen
mailto:la***@vkarlsen.no
http://presentationmode.blogspot.com/
Author
25 Nov 2007 8:31 PM
Michael D. Ober
Show quote
"Lasse Vågsæther Karlsen" <la***@vkarlsen.no> wrote in message
news:%23h3qll5LIHA.5208@TK2MSFTNGP04.phx.gbl...
> christ***@gmail.com wrote:
>> Anyone got a clue to why ther is a T between date and time in the
>> "formatted for sorting" or whatewer they call it, and a Z at the end
>> after seconds- got it fixed for my cobol programmer by formatting it
>> with yyyy ... aso, made the mistake with mm and MM but got it befre
>> someone saw) but really think its strange, excel dosent like that
>> format either. M$ not m$ compatible?
>>
>> Not a problem for me at the moment, just itrested if im missing
>> somethng useful.
>>
>> //CY
>
> If the format is for sorting, then it is for sorting, nothing else. It
> doesn't have to be compatible with anything other than other values in the
> same format.
>
> The format you saw included T for time and Z for zone information.
>
> If you need to create a string that Excel understands as a Date/Time
> value, pick a format that Excel understands and format for it using the
> ToString method and providing a list of format codes like the mm and MM
> you've discovered.
>
> An lastly, it's spelled Microsoft, not M$.
>
> --
> Lasse Vågsæther Karlsen
> mailto:la***@vkarlsen.no
> http://presentationmode.blogspot.com/
>


Actually, the MS formatting strings for date/time values are inconsistent.
Classic VB (and its derivatives such as VBA for Applications) use different
formatting rules than .NET languages.

Mike.
Author
25 Nov 2007 9:26 PM
Lew
"Lasse Vågsæther Karlsen" wrote:
>> An lastly, it's spelled Microsoft, not M$.

"M$" is a popular and widely-accepted abbreviation for "Microsoft".  Something
to do with Bill Gates not being a pauper, I suspect.

Perhaps M$ should embrace the colloquialism.

--
Lew
Author
25 Nov 2007 11:22 PM
Arne Vajhøj
Lew wrote:
> "Lasse Vågsæther Karlsen" wrote:
>>> An lastly, it's spelled Microsoft, not M$.
>
> "M$" is a popular and widely-accepted abbreviation for "Microsoft".

Not that widely accepted.

It is quite widely accepted among 20 year old students who think
they are so cool because they use Linux.

It is very rarely used among professionals (for rather obvious
reasons).

Arne
Author
25 Nov 2007 11:32 PM
Arne_Vajhøj
christ***@gmail.com wrote:
> Anyone got a clue to why ther is a T between date and time in the
> "formatted for sorting" or whatewer they call it, and a Z at the end
> after seconds- got it fixed for my cobol programmer by formatting it
> with yyyy ... aso, made the mistake with mm and MM but got it befre
> someone saw) but really think its strange, excel dosent like that
> format either. M$ not m$ compatible?

I don't get the Z at the end.

I do get the T.

The T is as specified in the ISO 8601 standard.

It is not a super popular format but it is a well known format.

I don't know why ISO chose the T instead of a space, but a guess
would be that it is easier to parse when the combined datetime
is a single "word".

Since ASCII sort actually works like a true datetime sort for this
format then it was obvious to use it for s formatting.

Arne
Author
26 Nov 2007 6:06 PM
christery
> I don't get the Z at the end.
>
>
> Arne

Well, thought it was some new standard, im getting it (T/Z), looks
like a combo of s and u in formatting , but in the examples on
internet I shouldnt be getting T, or just Z, well got past that.

And NO, Im not 20 year *NIX guru, but 40/OpenVMS trying to get some M$
running GW for an RFID readen on train wagons in the middle to talk to
my "real" system GW and then onwards to an ZOS running  AROS app for
your info.

To get things working, I try to figure out why they do like they do -
and if they will change this behaviour next upgrade of some dll file
ilke mdac has or any other M$ fundamentals like subst the common
control dll to english comdlg32 if im not really misstaken / was nnot
this called the dll-hell by one on my chat mates/ hmm.

//CY
Author
28 Nov 2007 2:52 AM
JeffWhitledge
> I don't get the Z at the end.
>
> I do get the T.
>
> The T is as specified in the ISO 8601 standard.

The Z is also specified is ISO 8601. It stands for Zulu and refers to
UTC. If a time is not in UTC, then another time zone is specified by
replacing the Z with a time-zone offset.

2007-11-27T20:49:00Z
is the same time as
2007-11-27T15:49:00-05:00

See http://en.wikipedia.org/wiki/ISO_8601 for more information.

AddThis Social Bookmark Button