I've spent way, way too much time on resolving this issue. I'm talking about timestamps. You'd think the subject pretty cut and dry: i get the user's browser and obtain their time and timezone. When she creates a new record that timestamp ought to go right into that "created date" field.
Not so fast.
Oracle has taken the position that a browser is a lousy way to get time. It's not reliable because the user can manipulate their browser to show the wrong time or geography. Oh well.
So what's the Oracle approach? Well, when you set up your user account, you can set the user's timezone. then, you can look up the timezone from the account and offset the value on a new record. You're going to use the webserver's time. there's no way around it, unless you want that browser time and that requires some effort using javascript.
Here's how i added a timestamp function to a "Create" button. After the row is instantiated on the screen, you perform the timestamp function and assign the value to the "Create Date" field.
Woof!

No comments:
Post a Comment