Time and Date Series Snippet Index
This Toolbox Snippet covers various methods of using MetaScript to record the server time and date in records.
Introduction
One common feature implemented in many systems is to record time and date information with records. Depending on the particular purpose, there are many methods that can accomplish this. What follows is a survey of existing Snippets that describe such methods.
Description
Toolbox Snippet - Using a Button to Record the Current Server Time and Date
This snippet illustrates how to use MetaScript in a button's click action script to record the current server time and date when the button is clicked.
Toolbox Snippet - Recording the Current Server Time and Date When a Specific Field is Modified
This snippet illustrates how to use MetaScript to record the current server time and date when a specific field in a form is modified by a user.
Toolbox Snippet - Recording the Current Server Time and Date when a Record is Created
This snippet illustrates how to use MetaScript to record the current server time when a record is created in the database.
Toolbox Snippet - Recording the Server Time and Date When a Record is Saved
This snippet illustrates how to use MetaScript to record the current server time and date whenever a record is saved/updated.
Toolbox Snippet - Recording the Server Time and Date When a Record is Opened for Editing
This snippet illustrates how to use a Global MetaScript to record the current server time and date whenever a record is opened for editing.
Toolbox Snippet - Recording the Server Time and Date Whenever Any Field is Modified
This snippet illustrates how to use a Global MetaScript to record the current server time and date whenever a user modifies any field in a form.
About Server Time
All the above snippets record time as "ServerTime" and date as "ServerDate". This is the time and date according the the clock in the Application Server. By using the server's time and date information instead of the time and date indicated by the client computer, several common inconsistencies can be avoided:
- Time and date is standardized even when client computers are in different time zones
- Time and date is consistent even when different client computers have clocks that are out of sync with each other