It seems like a very common problem that you have a Date/Time and you want it to be user local. So you ask the user for their timezone and you convert times to local when you load from the database, and you convert them to UTC when you save them to the database.
I have done this for systems in Smalltalk, Java (EJB), C++ and Ruby on Rails.
In Java(EJB) and Ruby on Rails there are hooks (Rails does automatically now with 2.1) that you can use in the persistence lifecycle to do the conversions.
My question is, what is the answer for how to do this in HIbernate/Spring? It seems people have been building on this stuff for years and there must be an obvious answer as to how to do this, but when I google, I dont seem to find anything relevant.
I have seen some stuff with the JSTL, but that doesn't work if you cant use them everywhere (which I cant in my situation).
Anyone?
Recent Comments