Question
- How are date and time handled in WebCenter?
- In what format are they saved?
- Which time zone do I see?
- What about date and time in e-mail notifications?
Answer
Date and time can be added in various places in WebCenter. Think about:
- Project Due Dates
- Task Due Dates
- Approval Due Dates
- Date Attributes in Project Attributes, Document Attributes or Task Specifications
- Wait nodes in Workflows
- ...and more
Storage in DB
Generally, there are two approaches on how dates are stored in the WebCenter database:
Text value with a timestamp:
This is the number of milliseconds since Jan 01, 1970 0:00 (UTC) as string value. This approach is used for attribute values of the Date and Time type. Such a number can be converted to a more human readable format on websites like http://www.epochconverter.com/.
SQL time stamp:
This is used for all other dates like project due date, task due date, approval due date, etc.. For MSSQL, we use the datetime
data type to store this information; for Oracle, we use the date
data type. If you look at these dates, for example, using MSSQL Server Management Studio, you will see that they are stored in the time zone of the server. In the server's memory, they are kept as SQL Timestamp, which means the number of milliseconds since Jan 01, 1970 0:00 (UTC).
Time zones
All dates in WebCenter are displayed in the time zone of the browser of the user. To check your current browser time zone, go to My WebCenter > My Profile and check Your Browser Timezone.
Entering dates is also considered to be done in the time zone of the browser of the user. The time zone of the user is not stored in the database, so the application server does not know the time zone of a user for conversion in e-mail notifications for example (see further).
Example of time zones and storage in DB:
A user in the UTC time zone enters a Project Due Date Aug 20, 2014 18:00
and as Project Attribute Milestone also Aug 20, 2014 18:00
. The server is in UTC+2. The observed date and time in MSSQL Server Management Studio is for the Project Due Date Aug 20, 2014 20:00
and for the Project Attribute Milestone value 1408557600000
. A user in UTC-4 sees the Project Due Date and Project Attribute Milestone as Aug 20, 2014 14:00
.
E-mail notifications
If an attribute value is displayed in an e-mail notification, it contains the number value as explained above. The other dates are displayed in WebCenter in the user language of the user in the time zone of the server (for example: Aug 20, 2014 18:00
- but this format can depend on the customization).
For more information about dates and time in e-mail notifications, also see:
Workflows
SmartNames in workflows can refer to date and time. For example, a Set Project Attribute node can be used to set a project attribute to the project due date. Usually they are resolved to SQL Timestamps which does not cause problems to set attributes to dates and vice versa. The only exception is the Send Notification node which will send e-mails since WebCenter 14.0.1 with all used date smart names (including date attributes) in the subject or body as human readable format (for examples: Aug 20, 2014 14:00
). This means, they are sent in server time zone and with the month in the language of the user the e-mail is sent to.
Default hour
If you pick a date from a date selector, the system typically presets the hour to 18:00
. You can change this behavior by following the steps described in:
The hour format is always the 24-hour format because it causes less confusion, it is the most commonly used time notation in the world and is used by the international standard ISO 8601. This format cannot be changed.
Daylight Saving Time
There are known problems with daylight saving time if a user sets a date in winter and the date it is referring to is in summer (or vice versa). There can be a 1-hour difference in this case. However, this is correctly solved for Date and Time attributes and for approval due dates.
1 Comment
Anonymous
It would be nice....since several versions... if the user could input the dates into the textfields without
using the calendar popup. if yo do this a lot its annoying to use the us format insteadt of the german 1.1.2014.
We have a lot of dummy tasks in the templates so that the user does have just to change date and start the task.
They are all set to 2099. Using the popup you have to click a lot to go back...