As the title says, is the output of Date.toString() (more precisely, Date.toTimeString() ) always in the same format in all browsers?
I ask about this since the EMCAScript specification says that "the contents of the string are implementation dependent."
I need to verify this, because I need to format the string by inserting HTML span elements as follows:
(new Date()).toTimeString().replace(" GMT", "<span id='offset'> GMT") + '</span>' );
This will create (in Google Chrome v28.0.1500.95) something like
18:19:26<span id="offset"> GMT-0700 (Pacific Daylight Time)</span>
which I can then using CSS.
Suggestions on the best ways to create output will also be great!
javascript date datetime
Alfred xing
source share