Dates, Milliseconds, Java and Firebug

In Clearspace we store dates using their millisecond representation rather than as a full fledged date in database tables because we don’t want to have to worry about how each database represents dates, but that means that whenever you’re looking at a Clearspace database table, you see values like this:

1172822399000

instead of something like this:

2007-03-01 23:59:59.000

which makes debugging dates a little harder. Firebug and JavaScript to the rescue! Open Firebug, click into the console area and then type this:

new Date(1172822399000);

and then click ‘run’ and voila. You’ve got the date. Have I told you how much I love Firebug?

One thought on “Dates, Milliseconds, Java and Firebug”

  1. Every time I talk to someone about Firebug, I learn something new. I’ve been doing a bunch of behind the scenes work on Fast Wonder this weekend – moving hosts, additional pages, css tweaks, etc., and I’ve spent a bunch of time with Firebug. Definitely one of my favorite plugins.

Leave a Reply

Your email address will not be published. Required fields are marked *