In comp.lang.javascript message <fbfd9f68-c963-48df-9bb0-4a07a4bc19ab@y3
8g2000hsy.googlegroups.com>, Sat, 6 Sep 2008 16:16:21, shapper
Not comprehensibly, though; so it does not count.
I have seen this happening, a few times with me, both in CSS and
Javascript groups.
Then you should have learned by now to trim quotes, especially sigs.
On my MVC application I have a few web pages with forms which has
inputs for date and time on the following format:
"2008-09-14 23:05:37"
Unspecified time zone; inadequate data. Assumed local.
1. Convert the UTC Date/Time in a form input to the Time Zone of the
user.
This should be done after the form is loaded so the value is there.
RegExp substitute - to /, append " UTC", read with new date(String).
You can show it with the non-UTC methods, and you can generate a numeric
offset indication from getTimezoneOffset. Offset abbreviations cannot
be generated, and cannot (apart from GMT & UTC) be read cross-browser.
2. Convert the Date/Time string inserted by the user from its TimeZone
to UTC and replace it in the input when the form is submitted.
Read it with new Date and no offset indication; use the UTC methods to
generate the reply string, followed by " UTC" or "Z" or numeric form for
clarity.
This way on my server side code I will get the correct Date/Time to
insert in the database.
I know this can't be done on the server side. On the server side I am
not able to get the Local Time Zone. Only UTC.
Note: When I say conversion I mean that in UTC 2008-09-13 23:10:40
might be 2008-09-14 02:10:40 ...
Which parts of that are not demonstrated in <URL:
http://www.merlyn.demon
..co.uk/js-dates.htm> ff.?
Note that it will be more efficient, user-side, to transmit/receive
date/times as milliseconds from UTC 1970.0 - and if server-side can
handle that, it will be efficient there too.
Which gives me an opportunity to ask how this might put in valid PHP?
PSEUDOCODE :
var Now = new Date( <?php echo +new Date() ?> ) // possibly
It's a good idea to read the newsgroup c.l.j and its FAQ. See below.