Re: Date and Time
- From: Thomas 'PointedEars' Lahn <PointedEars@xxxxxx>
- Date: Sun, 07 Sep 2008 23:41:04 +0200
shapper wrote:
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"
Which is the "user client zone" value, I presume? OK.
On my database I save all dates and times in UTC (http://www.iso.org/
iso/date_and_time_format) format.
And I asked you to define that. In particular, how do you store UTC in your
database? There are a number of ways, including the number of milliseconds
since epoch, several time formats, and one of the standard UTC formats.
The time format you are using determines what would be the best approach to
convert from and to it.
However I need to:
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.
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.
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.
So, what have you tried already?
Note: When I say conversion I mean that in UTC 2008-09-13 23:10:40
might be 2008-09-14 02:10:40 ...
It is not helpful, though.
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
.
- References:
- Date and Time
- From: shapper
- Re: Date and Time
- From: Thomas 'PointedEars' Lahn
- Re: Date and Time
- From: Thomas 'PointedEars' Lahn
- Re: Date and Time
- From: Dr J R Stockton
- Re: Date and Time
- From: Thomas 'PointedEars' Lahn
- Re: Date and Time
- From: shapper
- Date and Time
- Prev by Date: Re: Docmuentation for predefined objects, e.g. Image?
- Next by Date: Re: Javascript makes the current directory to change?
- Previous by thread: Re: Date and Time
- Next by thread: Re: Date and Time
- Index(es):
Relevant Pages
|