Time formatting is strange

  • Thread starter Thread starter christery
  • Start date Start date
C

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
 
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 said:
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$.


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.
 
"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 said:
"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
 
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
 
I don't get the Z at the end.

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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top