Search code examples
google-chromedeveloper-tools

Displaying values for date objects in Google Chrome Developer Tools


Is it possible in Google Chrome's Developer Tools (Developer -> Developer Tools or ctrl+shift+i) when inspecting script's date variables to see their values?

For example, Google Chrome:

end_date: Date
start_date: Date

Firefox:

end_date: Mon Nov 01 2010 00:00:00 GMT+0200 {}
start_date: Fri Oct 01 2010 00:00:00 GMT+0300 {}

This problem can be solved in Chrome by adding new watch: date_object.toString() but that is not really convenient, maybe there is some other way?

Update: Sorry i didn't specify it in the original question - date is not displayed on the Scripts tab in the 'Watch expressions', 'Scope variables' sections.


Solution

  • I'm not quite understand your question. As I can see the debugger is showing the Date in format you want.

    Could you please provide a use case for your problem.

    screenshot

    <html>
    <title>test</title>
    <head>
    <script>
    function test()
    {
        var t = new Date();
    }
    setTimeout(test, 1000);
    </script>
    </head>
    <body>
    </body>
    
    </html>