Why are you using longs to store dates?

If you keep them as dates then there is not an issue, as the appropriate conversion will we done for you (no matter what the database date settings are).