By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,091 Members | 1,917 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,091 IT Pros & Developers. It's quick & easy.

Time formatting is strange

P: n/a
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
Nov 25 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
ch*******@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/
Nov 25 '07 #2

P: n/a
"Lasse Vågsæther Karlsen" <la***@vkarlsen.nowrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
ch*******@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.
Nov 25 '07 #3

P: n/a
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
Nov 25 '07 #4

P: n/a
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
Nov 25 '07 #5

P: n/a
ch*******@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
Nov 25 '07 #6

P: n/a
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
Nov 26 '07 #7

P: n/a
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.
Nov 28 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.