Re: Date and Time



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
.



Relevant Pages

  • Re: Changing serial number
    ... zones to 25 server in different countries. ... The used number is greater then the new format. ... could change maintaining the zone transfer to all servers. ...
    (microsoft.public.windows.server.dns)
  • Server Date is -0600 UTC
    ... My server is in USA. ... of giving myself the current date and time in my zone +1000 UTC. ... var strDateNow = new Date; ...
    (microsoft.public.scripting.jscript)
  • why cant i turn off fast_time?
    ... both for the local zone and for utc ... [surely, i can make the box do everything in utc, i thought]. ... then i calculate the correct timestamps myself in my apps. ... i wouldn't bother writing except that congress decided to meddle, ...
    (freebsd-questions)
  • Re: SIA, Contact ID, 4/2, 3/1
    ... The following tables contain Contact ID and Automatic SIA format reporting ... For example, if zone 1 is an entry/exit point, you could ... Opening After Alarm System disarmed with alarm in memory A/R 58 ...
    (alt.security.alarms)
  • Re: script to check change in groups
    ... Dim strLastDateFile, objFSO, objDateFile ... Const ForReading = 1 ... ' Specify file where last change date (in UTC) is saved. ... The format of the whenChanged attribute is generalizedTime, ...
    (microsoft.public.windows.server.scripting)