I just started working with jquery yesterday in conjunctions with
Castle Monorail.  I'm spiking a very simple ajax call.
here is my html
<script type="text/javascript">
    $(document).ready(function() {
        $("#ajax-link").click(function() {
        $.getJSON("CurrentTime.mvc", function (time_from_the_server,
the_status) {
                $("#server-time").html(the_status + ' - ' +
time_from_the_server);
            });
        });
    });
</script>
<p><a id="ajax-link" href="#">Get</a> the current time from the
server.</p>
<div id="server-time">[should be displayed here]</div>

the results of the this are:
success - /Date(1232547949287-0500)/

reading up on json it appears that dates where an after thought. my
understanding is that the / mean it's not a literal string, it's a
date. 1232547949287 is epnoch, or seconds since 1970, or something
like that and -0500 is the timezone.

how can I convert /Date(1232547949287-0500)/ to display the actual
default date. something like:
Wednesday, January 21, 2009, 9:30 am

I believe I have to do some regex, prasing and eval the result. If
that is correct, then I should be able to build a prototype function
which could automatically convert this for me, correct?

Jason

Reply via email to